Download presentation
Presentation is loading. Please wait.
1
LA Load Address
2
LA Instruction type: RX Explicit Coding: B1,D2(X2,B2)
Example LA ,3(4,5) Example LA ,TABLE(7) Use: Creates an address (operand 2) which is loaded into the operand 1 register
3
What does it do? LA 8,Y R8 00 12 3D 8A (Before) R8 00 00 10 04 (After)
Memory F1 F2 F3 F4 F5 F6 F7 F8 F9 Address X’1000’ Y
4
What does it do? LA 8,Y(9) R8 00 12 3D 8A R9 00 00 00 04 R8
(Before) R8 D 8A R9 R8 (After) Memory F1 F2 F3 F4 F5 F6 F7 F8 F9 Address X’1000’ Y
5
What does it do? LA 7,5(8,9) (Before) R8 R9 R7 (Before) R7 (After)
6
What does it do? LA 7,5(0,9) or LA 7,5(,9) R8 00 00 20 00 R9
R9 (Before) R7 R7 (After)
7
What does it do? LA 7,5 or LA 7,5(0,0) R7 00 00 12 34 R7
(Before) R7 R7 (After) This is an effective way to load a “small” number into a register. Small means < Why?
8
An Assembly Listing LA 8,4(0,3) LA 8,4(,3) LA 8,4(3) LA 8,4(0,0) LA 8,4
9
LA Example use: Assume: TABLE DC F ‘1’ Assume address 1000 DC F ‘2’
TABENTRY DS F You execute: LA R7,8 LA R8,TABLE LA R9,0(R7,R8) MCV TABENTRY,0(R9) R9 After:
10
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)? LA is often used for loading multiple base registers: BASR R12,R0 USING *,R12,R11 LA R11,2048 LA R11,2048(R11,R12)
11
Try it in VisibleZ Try the following programs: la.obj
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.