glen herrmannsfeldt wrote:
> Michel Castelein wrote:
(snip)
>> So, I'm wondering why the expansion of the SAVE macro begins with a
>> DS 0H.
(snip)
(I previously wrote)
> I would guess, not looking at the macro, that it is used for
> any label on the SAVE. If there isn't a label then it may generate
> the DS without a label.
To follow up on my previous post, which I believe gave the
correct answer, at the end of this post is the source for the
OS/360 SAVE macro.
There are options, done through conditional assembly, depending
on the third, ID, parameter. Most of my assembly code was
Fortran callable subroutines so I believe I used the ID option
which adds the name to the Fortran traceback routine.
(In most cases I manually coded this, and didn't use SAVE.)
In any case, if the ID option is used the &NAME is applied to a B
instruction to branch around the name. The branch offset is rounded
up to a multiple of two, as necessary, but no DS 0H is needed after
the DC instruction. The assembler will correctly assemble the STM
instruction at an even address. If * is used for the ID parameter,
&NAME is used for the assembled ID, or, if no &NAME then the CSECT
name is used. This could be used for ENTRY points to a routine.
If the ID option is not used, &NAME DS 0H is used to start the
expansion so that &NAME has a place to go.
Note also, as discussed recently in another newsgroup, the special
case for K'&ID greater than 8, as SETC symbols were limited to eight
characters.
I believe this is consistent with my previous post, the first
with the correct answer.
../ ADD NAME=SAVE,SSI=
MACRO
&NAME SAVE ®,&CODE,&ID
LCLA &A,&B,&C
LCLC &E,&F,&G,&H
AIF ('®' EQ '').E1
AIF ('&ID' EQ '').NULLID
AIF ('&ID' EQ '*').SPECID
&A SETA ((K'&ID+2)/2)*2+4
&NAME B &A.(0,15) BRANCH AROUND ID
&A SETA K'&ID
DC AL1(&A) LENGTH OF IDENTIFIER
..CONTB AIF (&A GT 32).SPLITUP
..CONTAA AIF (&A GT 8).BRAKDWN
&E SETC '&ID'(&B+1,&A)
DC CL&A'&E' IDENTIFIER
AGO .CONTA
..BRAKDWN ANOP
&E SETC '&ID'(&B+1,8)
DC CL8'&E' IDENTIFIER
&B SETA &B+8
&A SETA &A-8
AGO .CONTAA
..SPLITUP ANOP
&E SETC '&ID'(&B+1,8)
&F SETC '&ID'(&B+9,8)
&G SETC '&ID'(&B+17,8)
&H SETC '&ID'(&B+25,8)
DC CL32'&E.&F.&G.&H' IDENTIFIER
&B SETA &B+32
&A SETA &A-32
AGO .CONTB
..NULLID ANOP
&NAME DS 0H
AGO .CONTA
..SPECID AIF ('&NAME' EQ '').CSECTN
&E SETC '&NAME'
&A SETA 1
..CONTQ AIF ('&E'(1,&A) EQ '&E').LEAVE
&A SETA &A+1
AGO .CONTQ
..LEAVE ANOP
&B SETA ((&A+2)/2)*2+4
&NAME B &B.(0,15) BRANCH AROUND ID
DC AL1(&A)
DC CL&A'&E' IDENTIFIER
AGO .CONTA
..CSECTN AIF ('&SYSECT' EQ '').E4
&E SETC '&SYSECT'
&A SETA 1
AGO .CONTQ
..E4 IHBERMAC 78,360 CSECT NAME NULL
..CONTA AIF (T'®(1) NE 'N').E3
AIF ('&CODE' EQ 'T').CONTC
AIF ('&CODE' NE '').E2
&A SETA ®(1)*4+20
AIF (&A LE 75).CONTD
&A SETA &A-64
..CONTD AIF (N'® NE 2).CONTE
STM ®(1),®(2),&A.(13) SAVE REGISTERS
MEXIT
..CONTE AIF (N'® NE 1).E3
ST ®(1),&A.(13,0) SAVE REGISTER
MEXIT
..CONTC AIF (®(1) GE 14 OR ®(1) LE 2).CONTF
STM 14,15,12(13) SAVE REGISTERS
&A SETA ®(1)*4+20
AIF (N'® NE 2).CONTG
STM ®(1),®(2),&A.(13) SAVE REGISTERS
MEXIT
..CONTG AIF (N'® NE 1).E3
ST ®(1),&A.(13,0) SAVE REGISTER
MEXIT
..CONTF AIF (N'® NE 2).CONTH
STM 14,®(2),12(13) SAVE REGISTERS
MEXIT
..CONTH AIF (N'® NE 1).E3
STM 14,®(1),12(13) SAVE REGISTERS
MEXIT
..E1 IHBERMAC 18,360 REG PARAM MISSING
MEXIT
..E2 IHBERMAC 37,360,&CODE INVALID CODE SPECIFIED
MEXIT
..E3 IHBERMAC 36,360,® INVALID REGS. SPECIFIED
MEND


|