Can someone please help me in understanding the below Assembler program ? I have been referring online manuals and also reading MVS Assembler Language by Kevin McQuillen and Anne Prince but still haven't been able to understand the below program.
I added the notes after each statement.Can someone please correct me on those notes?
PUNCH ' ALIAS XXXXXLST '
XXXXXARG START 0
ENTRY XXXXXLST ->It looks like XXXXXLST is the starting point of this subprogram.
EXTRN XXXXXQLK->It looks like we are defining XXXXXQLK as an external module.
USING *,15
B COIBMEND
*
DC C'XXXXX COPYRIGHT IBM CORP. 19XX'
DC C'XXXXXARG1,0'
*
R1 EQU 1 -> defining R1 as Register 1
R2 EQU 2 -> defining R2 as Register 2
R3 EQU 3 ->defining R3 as Register 3
RF EQU 15 -> defining RF as Register 15
COIBMEND EQU *
BALR RF,0 -->This and the below USING command will insert the address of the next sequential instruction into RF and will set it as the base register.
USING *,RF
SAVE (14,12)-> Save the contents of Registers 14 through 12.
LA R2,XXXXXLST -->Load the address of XXXXXLST to R2 Register.
LH R3,=H'4'--> Loads the half word 4 to Register R3.
RESUME MVC 0(4,R2),0(R1)-> Moves the contents of Register R1 to Register R2 after 4 Bytes.
TM 0(R1),X'80' -->Test under Mask Condition.X’80’ will be converted to ‘1000 0000’ and the left most bit will be the selected bit.
I know what this is.but I’m not sure why we are doing this.
BO EXIT--> Exit the program if selected bit was 1.
AR R1,R3--> Add register 3 contents to Register 1
AR R2,R3 -->Add register 3 contents to Register 2
B RESUME-> GOTO RESUME
EXIT RETURN (14,12),RC=0 (control is returned to calling programming) 1-5
XXXXXLST DS 0D --> I read that this is to align the location counter to a doubleword.but not sure why we are doing or how.
ARG01 DC F'0'-->counter for ARG01(initially -0)
ARG02 DC F'0'-->counter for ARG01(initially -0)
ARG03 DC F'0'-->counter for ARG01(initially -0)
ARG04 DC F'0'-->counter for ARG01(initially -0)
ARG05 DC F'0'-->counter for ARG01(initially -0)
ARG06 DC F'0'-->counter for ARG01(initially -0)
ARG07 DC F'0'-->counter for ARG01(initially -0)
ARG08 DC F'0'-->counter for ARG01(initially -0)
ARG09 DC F'0'-->counter for ARG01(initially -0)
ARG10 DC F'0'-->counter for ARG01(initially -0)
PATCHES DC 4F'0' XXARG PATCH AREA
PATCHCON DC A(XXXXXQLK) ADDR OF CSECT CONTAINING PATCH AREA --> Address constant for XXXXXQLK
LTORG
END
Thanks,
Ram Kumar