Hi, everyone I'm currently taking an assembly course (HLASM), I just had one question about explicit addressing D(X,B), How do I know what register to use as an index register? how do I know what value to input as a displacement value? how do I know what register to use as a base register? I often see examples like
5,8(0,2) but I dont understand what that goes or what that does, is it like an array? thank you
USING IHADCB,5 ESATABLISH DCB DATA AREA ADDRESSING
LA 5,ADCB COMPUTE DCB ADDRESS
MVC RECFM,=CL8' ' INITIALIZE THE RECFM OUTPUT AREA
LA 0,RTABN LOAD ENTRIES IN RTAB
LA 1,RTAB COMPUTE ADDRESS OF RTAB
LA 14,RECFM COMPUTE ADDRESS OF RECFM OUTPUT AREA
RECFM1 MVC WKAREA,DCBRECFM COPY BINARY RECFM TO A WORK AREA
NC WKAREA,0(1) ISOLATE ATTRIBUTE BITS
CLC WKAREA,1(1) ATTRIBUTE IN DCBRECFM?
BNE RECFM2 NO
MVC 0(1,14),2(1) COPY ATTRIBUTE TEXT TO OUTPUT
LA 14,1(,14) ADD 1 TO OUTPUT AREA POINTER
RECFM2 LA 1,3(,1) COMPUTE ADDRESS OF NEXT RTAB ENTRY
BCT 0,RECFM1 CHECK IT
DROP 5 KILL DCB DATA AREA ADDRESSING
...
RECFM DC CL5' ' RECFM TEXT
WKAREA DC XL1'0' WORK AREA
ADCB DCB DSORG=PS,MACRF=PM,RECFM=VBA,LRECL=125 DEFINE A DCB
* RTAB - TABLE TO TRANSLATE DCBRECFM ATTRIBUTES TO TEXT
* OFFSET PURPOSE
* 0 ATTRIBUTE MASK
* 1 ATTRIBUTE
* 2 ATTRIBUTE TEXT
RTAB DC AL1(DCBRECL,DCBRECF,C'F')
DC AL1(DCBRECL,DCBRECV,C'V')
DC AL1(DCBRECL,DCBRECU,C'U')
DC AL1(DCBRECBR,DCBRECBR,C'B')
DC AL1(DCBRECSB,DCBRECSB,C'S')
DC AL1(DCBRECTO,DCBRECTO,C'T')
DC AL1(DCBRECCC,DCBRECCA,C'A')
DC AL1(DCBRECCC,DCBRECCM,C'M')
RTABN EQU (*-RTAB)/3
...
DCBD DEVD=DA,DSORG=PS