YREGS * Define register names
...
* This contrived routine reads a file and copies the first record,
* and all non-blank records after it. It can be invoked by the instruction:
* BAL R14,COPYRTN
*
* Register usage:
* R2 = record pointer
* R9 = return address from subroutine
* R14= return address from copy routine
*
COPYRTN ST R14,RET_ADR * Save our return address
BAL R9,READ * Go read the first record
LOOP MVC LINE,0(R2) * move data to print line.
BAL R9,WRITE * and go run the print routine.
SKIP BAL R9,READ * Go get the next record.
CLC SPACES,0(R2) * Is the record blank?
BNE LOOP * no, go write it.
B SKIP * yes, just read the next.
*
* End-of-file: return to invoker
ALLDONE L R14,RET_ADR * Retrieve return address
BR R14 * and return
*
READ READ INPUT * Read a record.
LR R2,R1 * Put record addr into reg-2
BR R9 * and return.
*
WRITE PUT OUTPUT,LINE * write current line,
BR R9 * and return.
*
spaces DC CL80' ' * Use to see if the input rec is blank.
LINE DC CL80' ' * Print line.
*
INPUT DCB DDNAME=INFILE,DSORG=PS,DEVD=DA,EODAD=ALLDONE
OUTPUT DCB DDNAME=NEWFILE,DSORG=PA,DEVD=DA,LRECL=80,RECFM=FB
*
To the Opcodes Overview.
To the English Homepage for Hlasm.com.
To the General Homepage for Bixoft and Hlasm.com.
|
This site is a member of WebRing. You are invited to browse the list of mainframe-loving sites. |
|
Dinos are not dead. They are alive and well and living in data centers all around you. They speak in tongues and work strange magics with computers. Beware the dino! And just in case you're waiting for the final demise of these dino's: remember that dinos ruled the world for 155-million years! |
|
Dinos and other anachronisms [ Join Now | Ring Hub | Random | << Prev | Next >> ] |
||
Below you find the logo of our sponsor and logos of the web-standards that this page adheres to.
|
|
|
|
||