90 likes | 212 Views
L Load Fullword. L. Instruction type: RX Explicit Coding: R1,D2(X2,B2) Example L 5,3(4,5) Example L 8,TABLE(R7) Use: The word (4 bytes) at the operand 2 address is loaded into the operand 1 register. What does it do?. L R8,Y. R8. 00 12 3D 8A (Before).
E N D
L • Instruction type: RX • Explicit Coding: R1,D2(X2,B2) • Example L 5,3(4,5) • Example L 8,TABLE(R7) • Use: The word (4 bytes) at the operand 2 address is loaded into the operand 1 register
What does it do? L R8,Y R8 00 12 3D 8A (Before) R8 F5 F6 F7 F8 (After) Memory F1 F2 F3 F4 F5 F6 F7 F8 F9 Y
What does it do? L R8,Y(9) (Before) R8 00 12 3D 8A R9 00 00 00 04 R8 F6 F7 F8 F9 (After) Memory F1 F2 F3 F4 F5 F6 F7 F8 F9 Y
What does it do? L R7,4(R8,R9) (Before) R8 00 00 20 00 R9 00 00 10 00 R7 FF FF FF FF 22 33 44 55 (After) 00 00 00 11 22 33 44 55 66 Memory X’3000’ X’3004’
What does it do? L R7,4 (Before) R7 12 34 56 78 This effective address is 4. Executing this instruction causes a protection exception (SOC 4) since we are referencing storage that is outside of our assigned region.
L Example • Example use: Assume: TABLE DC F ‘1’ Assume address 1000 DC F ‘2’ DC F ‘3’ You execute: LA R7,TABLE L R8,0(R0,R7) L R9,4(R0,R7) L R10,8(R0,R7) R8 After: R9 After: R10 After: 00000001 00000002 00000003
Programming Tips • It’s easy to make a simple mistake by coding L for LA or LA for L. Give it a moment’s extra thought when you code these. Do you want an address (LA)? Or do you want the contents at an address (L)?
Try it in VisibleZ • Try the following programs: • l.obj • l1.obj • l2.obj