Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

ASSEMBLER-L - Makro für DIAG-Befehl (und Diskussion dazu)

Subject:

Re: macros to implement opcodes

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>

Date:

2013.12.21 15:46:46


Just in case it is not obvious to you or anyone else ... there are such moments:

          MACRO ,
  &LABEL  DIAG  &R1,&R2,&I1
  &LABEL  LA    &R1,&I1.(&R2.,0)    Diagnose
          ORG   &LABEL
          DC    X'83'
          ORG  ,
          MEXIT  ,
          MEND  ,


if the label is omitted, the ORG &LABEL becomes an empty ORG, and the DC X'83'
then lies behind the LA instruction, at the position of the LA plus 4.

Only if there is a label, the ORG will position the location counter at the
start of the LA instruction and so the DC X'83' will overwrite the op code of
the LA.

Kind regards

Bernd



Am 21.12.2013 15:32, schrieb Bernd Oppolzer:
> Sorry, but that's different.
>
> A macro has to generate correct code, no matter
> if the user of the macro chooses to use a label on the macro
> call or if he or she chooses to omit the label. But in the case
> of the macro definition you provided the correct function of the
> generated code relies upon the fact that a label is provided -
> without generating any kind of syntax error, BTW -
> and that is not ok.
>
> Kind regards
>
> Bernd

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie