Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly 370 > Re: Assembler: ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 13 Topic 248 of 328
Post > Topic >>

Re: Assembler: alignment of machine instructions

by glen herrmannsfeldt <gah@[EMAIL PROTECTED] > Jul 19, 2005 at 01:43 PM

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  &REG,&CODE,&ID
          LCLA  &A,&B,&C
          LCLC  &E,&F,&G,&H
          AIF   ('&REG' 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'&REG(1) NE 'N').E3
          AIF   ('&CODE' EQ 'T').CONTC
          AIF   ('&CODE' NE '').E2
&A       SETA  &REG(1)*4+20
          AIF   (&A LE 75).CONTD
&A       SETA  &A-64
..CONTD   AIF   (N'&REG NE 2).CONTE
          STM   &REG(1),&REG(2),&A.(13)           SAVE REGISTERS
          MEXIT
..CONTE   AIF   (N'&REG NE 1).E3
          ST    &REG(1),&A.(13,0)                 SAVE REGISTER
          MEXIT
..CONTC   AIF   (&REG(1) GE 14 OR &REG(1) LE 2).CONTF
          STM   14,15,12(13)                      SAVE REGISTERS
&A       SETA  &REG(1)*4+20
          AIF   (N'&REG NE 2).CONTG
          STM   &REG(1),&REG(2),&A.(13)           SAVE REGISTERS
          MEXIT
..CONTG   AIF   (N'&REG NE 1).E3
          ST    &REG(1),&A.(13,0)                 SAVE REGISTER
          MEXIT
..CONTF   AIF   (N'&REG NE 2).CONTH
          STM   14,&REG(2),12(13)                 SAVE REGISTERS
          MEXIT
..CONTH   AIF   (N'&REG NE 1).E3
          STM   14,&REG(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,&REG               INVALID REGS. SPECIFIED
          MEND
 




 13 Posts in Topic:
Assembler: alignment of machine instructions
"Michel Castelein&qu  2005-07-13 23:13:45 
Re: Assembler: alignment of machine instructions
richgr@[EMAIL PROTECTED]   2005-07-13 21:37:48 
Re: Assembler: alignment of machine instructions
Binyamin Dissen <posti  2005-07-14 11:26:02 
Re: Assembler: alignment of machine instructions
"arargh" arargh  2005-07-13 18:00:03 
Re: Assembler: alignment of machine instructions
glen herrmannsfeldt <g  2005-07-13 21:27:03 
Re: Assembler: alignment of machine instructions
glen herrmannsfeldt <g  2005-07-19 13:43:28 
Re: Assembler: alignment of machine instructions
Binyamin Dissen <posti  2005-07-14 11:26:04 
Re: Assembler: alignment of machine instructions
"John Small" &l  2005-07-14 10:50:59 
Re: Assembler: alignment of machine instructions
glen herrmannsfeldt <g  2005-07-25 16:03:55 
Re: Assembler: alignment of machine instructions
"Michel Castelein&qu  2005-07-26 08:25:21 
Re: Assembler: alignment of machine instructions
"Sven Pran" <  2005-07-27 09:45:31 
Re: Assembler: alignment of machine instructions
beu@[EMAIL PROTECTED] (B  2005-07-27 20:50:58 
Re: Assembler: alignment of machine instructions
"Sven Pran" <  2005-07-28 00:11:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 20 17:33:50 CDT 2008.