2
process
exit
space
equ
get
lr
put
b
space
equ
close
1
lr
1 1m br
space
savearea dc
indata dcb
EDIT: Smark 3 savel input
EDIT:
4 INPUT: outdata
EDIT:
file
R;
dcb
dcbd
space
end
*
indata
r2,r1
outdata,(2)
process
*
read a record from input file
save address of record move it to output
continue until end-of-file (indata"outdata) close files
r13,savearea+4 addr of caller's save area
r15,r3 load return code
r14,12(r13) get return address
rO,r12,20(r13) restore regs
r14 bye ••• 18f'0'
ddname=indd,aacrf=gl,dsorg=ps,recfm=f,lrecl=80,
eodad=exit
ddname=outdd,macrf=pm,dsorg=ps
5 global mac lib osmacro R;
6 assemble ostest
*
*
*
*
*
*
*
2 Since the DCB macro statement takes up more than one line, you have to enter a
continuation character in column 72. To do this, you can enter a null line to return
to edit mode and execute the SMARK edit macro, which places an asterisk in column
72. If the SMARK edit macro is not on your system, you viII have to enter a
continuation character some other way. (See "Entering a Continuation Character in
Column 72" in "Section 5. The CMS Editor.")
3 Before continuing to enter input lines, the EDIT subcommand SlVE is issued to write
what has already been written onto disk. The CP logical line end symbol (I) separates the SAVE and INPUT subcommands.
4 A null line returns you to edit mode. You may wish, at this point, to proofread
your input file before issuing the FILE subcommand to write the ASSEMBLE file onto
disk.
5 Since this assembler program uses OS macros, you must issue the GLOBAL command to
identify the CMS macro library, OS MACRO 8ACLIB, before you can invoke the assembler. 6 The ASSEMBLE command invokes the V8/370 assembler to assemble the source file; the
asterisks (*) indicate the CMS blip character, which you mayor may not have made active for your virtual machine.
366 IBM VM/370 CMS User's Guide
March 30, 1979
7 ASSEMBLER DONE OST00230 23 LA R3,O INITIALLY SET RETURN CODE IF0188 R3 IS AN UNDEFINED SYMBOL OST00240 24 OPEN (INDATA,OUIDATA,(CUTPUT» OPEN FILES 4000000 27+ 12,*** IHB002 INVALlt OPTION OPERAND SPECIFIED-CUTDATA IF0197 *** MNOTE *** OST00290 32 LA R3,100 SET RETURN CODE IF0188 R3 IS AN UNDEFINED SYMBOL OST00340 37 LA R3,200 SET RETURN CODE IF0188 R3 IS AN UNDEFINED SYMBOL OST00460 63 LR R15,R3 LOAD RETURN CODE IF0188 R3 IS AN UNDEFINED SYMBOL NUMBER OF STATEMENTS FLAGGED IN THIS ASSEMELY = 5 R (00012) ;
8 edit os test assemble
locate Ir2 R2 EQU 2
i r3
lopen egu 3 OPEN (INDATA,OUTDATA, (OUTPUT» c 1,1,,1 OPEN {INDATA, ,OUTDATA, (OUTPUT}) 9 file R; assemble ostest
* * *
*
*
* 10 ASSEMBLER DONE NO STATEMENTS FLAGGED IN THIS ASSEMBLY R; 11 filedef indd disk test data a
R;
12 filedef outdd punch R; 13 tcp spool punch to * OPEN FILES OPEN FILES
7 The assembler displays errors encountered during assembly. Depending on how
accurately you copied the program in this sample session, you mayor may not receive
some of these messages; you may also have received additional messages.
8 You must edit the file OSTEST ASSEMBLE and correct any errors in it. The errors
placed in the example included a missing comma on the OPEN macro, and the omission
of an EQU statement for a general register. These changes are made as shown. The CMS editor accepts a diagonal (I) as a LOCATE subcommand.
9 After all the changes have been made to the ASSEMBLE file, you can issue the FILE
subcommand to replace the existing copy on disk, and then reassemble it. 10 This time, the assembler completes without encountering any errors. If your ASSEMBLE file still has errors, you should use the editor to correct them.
11 The FILEDEF command is used to define the input and output files used in this
program. The ddnames INDD and OUTDD, defined in the DCBs in the program, must have a
file definition in eMS. To execute this program, you should have a file on your
A-disk name TEST DATA, which must have fixed-length, 80-character records. If you
have no such file, you can make a copy of your ASSEMBLE file as follows:
copy file ostest assemble a test data a
12 The output file is defined as a punch file, so that it will be written to your
virtual card punch.
13 The CP SPOOL command is issued, using the tcp function, to spool your virtual punch
to your virtual card reader. When you use the tcp function, you do not receive a
Ready message. Sample Terminal Session for OS Programmers 367
Previous Page Next Page