The program reads statements from SYSIN until it reaches end-of-file,
or encounters a statement with an “E” in column 1. The program
validates the location in the object to set or display, and branches
to the appropriate routine to process the request.
*
* Loop reading from SYSIN. Process the statements.
* Treat EOF as if the user specified "E" as the function to perform.
*
LREAD EQU * Read first/next card
MVI VCARDF,C'E' EOF will appear as "E" function
LA R4,L31B02 Return to L31B02 in 31-bit mode
LA R1,L24B02 Go to L24B02 in 24-bit mode
BSM R4,R1 R4 = A(X'80000000'+L31B02)
L24B02 GET VSYSIN,VCARD Get the next input request.
LEOF EQU * End-of-file branches here
BSM 0,R4 Return to 31-bit mode at next instr
L31B02 EQU * Get here in 31-bit mode
*
* Process request:
* E - End processing
* S aaaaaaaa v - Set location X'aaaaaaaa' to v
* D aaaaaaaa - Display location X'aaaaaaaa'
*
CLI VCARDF,C'E' EOF function or EOF on data set ?
BE LCLOSE * Yes -- go cleanup and terminate
TRT VCARDA,CTABTRT Ensure A-F, 0-9
BNZ LINVADDV * If not, is error
MVC VTEMP8,VCARDA Save address
TR VTEMP8,CTABTR Convert to X'0A'-X'0F', X'00'-X'09'
PACK VCHGADDR(5),VTEMP8(9) Make address
L R1,VCHGADDR Address
LA R1,0(,R1) Clear hi-bit
ST R1,VCHGADDR Save address to change/display
CLI VCARDF,C'D' Display requested ?
BE LDISP * Yes -- go process
CLI VCARDF,C'S' Set requested ?
BNE LINVFUNC * No -- is invalid statement