There is hidden functionality in this macro. 1. I believe that john said that LA will resolve a label reference in the assembler. I'm not sure of the situations it fixes.
2. Coding the (0) on the LA causes an error message when the destination is a literal or has a length specified. This eliminates code to check for these situations. Checking the length will only work if the label is defined before the check. Jon. ________________________________ From: Paul Gilmartin <[email protected]> Largely, I was puzzled by the complexity of John's solution: Macro &Lab MVC2 &Target,&Source &Lab CLC 0(0,0),&Source X'D500 0000',S(&Source) Org *-6 Back up to first byte of instruction LA 0,&Target.(0) X'4100',S(&Target),S(&Source) Org *-4 Back up to first byte of instruction DC AL1(X'D2',L'&Source-1) First 2 bytes of instruction Org *+4 Step to next instruction ... What's accomplished by overwriting the instruction 3 times, and using a hex opcode? (And I believe this would allow modifying the literal pool which we agree is a Bad Thing. Safer to use ST in place of the LA.) AIF (L'&Target ge L'&Source).Done MNote *,'MVC2: Length of ''&Source'' greater than length of ''&* Target''.' .Done MEnd The check on target length could still be performed after simply the: &Lab MVC &Target.(L'&Source),&Source (Is explicitly specifying index register 0, as on the LA considered good coding practice? It seems superfluous.) Thanks, gil
