Generate a DSECT and USING.

On Mon, 26 Feb 2024 08:22:00 -0500 David Eisenberg <[email protected]>
wrote:

:>I’m seeking some guidance if anyone is able to help. I’d like to write a 
macro like this:
:>
:>&NAME    MYCLC &FIELD1,&FIELD2
:>
:>in which both &FIELD1 and &FIELD2 are relocatable addresses. It’s &FIELD1 
that is of particular interest to me. &FIELD1 might be expressed as a 
hard-coded displacement and base register, or a relocatable symbol… or it could 
be an absolute symbol equivalent to a displacement, followed by a base register…
 etc. I.e., it could be any valid relocatable address syntax. What &FIELD1 will 
*not* have is an *explicit length.* The macro parameters will specify valid 
relocatable addresses, and nothing more.
:>
:>My question: I’d like the MYCLC macro to generate a CLC instruction in which 
the two parameters are compared to each other for a constant length of 2. So 
far, the only ways I can think of to do this are:
:>
:>1. Parse &FIELD1 to figure out how the relocatable address is expressed, and 
insert an explicit length of 2 to generate a valid CLC first operand. I would 
do it that way, but (unless I'm missing something) it seems quite complex to 
code.
:>2. Generate this DC statement: DC X’D501’,S(&FIELD1,&FIELD2) . This seems to 
work, but it’s a bit unattractive in a PRINT GEN (and it looks a bit odd in the 
assembly listing, because the assembler doesn't treat it like a machine 
instruction in the object code on the left side of the listing).
:>
:>I’m wondering if anyone can suggest a reasonable way to code option 1 above. 
Can the macro assembler give me any help in parsing &FIELD1 so that I can 
transform that parameter to insert an explicit length, regardless of how 
&FIELD1 is expressed? Or is there some other approach that I haven’t considered 
at all? Or should I just go with option 2 above?
:>
:>Please note that I don’t want the macro to generate more than one machine 
instruction. One way or another, I just want the macro to generate a CLC for a 
length of 2. (And I really do want the CLC located in the macro as opposed to 
open code, because the macro does some analysis on the comparands prior to 
generating the CLC.)
:>
:>Any advice would be appreciated... thank you!
:>
:>David

--
Binyamin Dissen <[email protected]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

Reply via email to