START - Specify name and starting address for the program.
END - Indicate the end of the source program and specify the first
executable instruction in the program.
BYTE - Generate character or hexadecimal constant , occupying as many
bytes as needed to represent the constant.
WORD - Generate one-word integer constant.
RESB - Reserve the indicated number of bytes for a data area.
RESW – Reserve the indicated number of words for a data area.
The program contains a main routine that reads records from an input device (identified with device code F1) and copies them to an output device . This main routine calls subroutine RDREC to read a record into a buffer and subroutine WRREC to write the record from the buffer to the output device. Each subroutine must transfer the record one character at a time because the only I/O instructions available are RD and WD. The buffer is necessary because the I/O rated for the two devices, such as a disk and a slow printing terminal , may be very different. The end of each record is marked with a null character (hexadecimal 00). If a record s longer than the length of the buffer (4096 bytes),only the first 4096 bytes are copied. The end of the file to be copied is indicated by a zero-length record. When the end of file is detected, the program writes EOF on the output device and terminates by executing an RSUB instructions. We assume that this program was called by the Operating system using a JSUB instruction ; thus , the RSUB will return control to the operating system.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment