Hi all,
I need clarification on the use of index Reg and displacement. When we use RX instruction, we define second operand by giving index,base and displacement. Can any one tell me how displacement and index works? why we are using them? Individual significance of index,displacement and base.
Thanks in advance
INDEXR RSECT
USING *,2
SAVE (14,2)
LR 2,15
TIME BIN
SR 0,0
STM 0,1,64(13)
CVB 1,64(,13)
D 0,=F'1000'
LA 14,1900(,1)
LR 15,14
LR 1,0
LA 0,B'11'
NR 14,0
BNZ NOTLEAP
D 14,=F'100'
LTR 14,14
BNZ ISLEAP
NR 15,0
BZ ISLEAP
NOTLEAP CH 1,=AL2(31+28)
BNH ISLEAP
LA 1,1(,1)
ISLEAP IC 14,TAB1(1) <- First use of an index register
SLL 14,1
SH 1,TAB2(14) <- Second use of an index register
LR 15,1
RETURN (14,2),RC=(15)
LTORG ,
TAB2 EQU *-2
DC AL2(0)
DC AL2(31)
DC AL2(31+29)
DC AL2(31+29+31)
DC AL2(31+29+31+30)
DC AL2(31+29+31+30+31)
DC AL2(31+29+31+30+31+30)
DC AL2(31+29+31+30+31+30+31)
DC AL2(31+29+31+30+31+30+31+31)
DC AL2(31+29+31+30+31+30+31+31+30)
DC AL2(31+29+31+30+31+30+31+31+30+31)
DC AL2(31+29+31+30+31+30+31+31+30+31+30)
TAB1 EQU *-1
DC 31AL1(1),29AL1(2),31AL1(3)
DC 30AL1(4),31AL1(5),30AL1(6)
DC 31AL1(7),31AL1(8),30AL1(9)
DC 31AL1(10),30AL1(11),31AL1(12)
END INDEXR