System Software – SIC/XE Program to write a subroutine for SIC that writes record on to device 05

Problem Statement

Suppose that RECORD contains a 100-byte record. Write a subroutine for SIC that will write this record on to device 05.

Solution

Line NumberCodeComment
1JSUB WRREC 
2WRREC LDX ZERO 
3WLOOP TD OUTPUT 
4JEQ WLOOP 
5LDCH RECORD, X 
6WD OUTPUT 
7TIX LENGTH 
8JLT WLOOP 
9RSUB 
10ZERO WORD 0 
11LENGTH WORD 1 
12OUTPUT BYTE X ‘05’ 
13RECORD RESB 100 
   
%d