> I'm surprised that this would assemble. > > R:F 00000 20 USING TEST5,R15 > 21 * > 0000 4810 F010 00010 22 LH R1,=H'-4096' > R:1 FFF000 23 USING -4096,R1 > 0004 4120 F004 00004 24 LA R2,* > 0008 4130 2FFC FFFFFC 25 LA R3,-4(,R2) > 26 * > 0010 27 LTORG > 0010 F000 28 =H'-4096' > > I don't understand why the instruction at line 25 assembles > as 4130 2FFC. As far as I can see, it should generate an error. > > Still, Robin is correct. The base-displacement arithmetic is > addition only. The displacement is an unsigned value from 0 > to 4095. So, if the program is loaded into location 1000 and > executed, statement 24 would set register 2 to x'1004' and > statement 25 would set register 3 to x'2000'. That is, 1004+FFC.
You added the same USING I did to establish addressability of the literal pool. But that also seems to mess up the original problem because the weird R1 stuff isn't used anymnore. R2 is set to the address of the first LA instruction. R3 is set to R2+FFC. Surely the R1 stuff is meant to do *something*? Fred! ----------------------------------------------------------------- ATTENTION: The information in this electronic mail message is private and confidential, and only intended for the addressee. Should you receive this message by mistake, you are hereby notified that any disclosure, reproduction, distribution or use of this message is strictly prohibited. Please inform the sender by reply transmission and delete the message without copying or opening it. Messages and attachments are scanned for all viruses known. If this message contains password-protected attachments, the files have NOT been scanned for viruses by the ING mail domain. Always scan attachments before opening them. -----------------------------------------------------------------
