Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. The macro definitions in Fig. 4.1 contain several statements in which macro parameters are concatenated with other characters (for exam- ple, lines 50 and
1. The macro definitions in Fig. 4.1 contain several statements in which macro parameters are concatenated with other characters (for exam- ple, lines 50 and 75). Why was it not necessary to use concatenation operators in these statements? Line Source statement COPY RDBUFF START MACRO 0 COPY FILE FROM INPUT TO OUTPUT & INDEV, &BUFADR, &RECLTH MACRO TO READ RECORD INTO BUFFER 5 10 15 20 25 30 35 40 CLEAR LOOP COUNTER 45 50 55 60 CLEAR CLEAR CLEAR +LDT TD JEQ RD COMPR JE STCH TIXR JLT STX MEND MACRO A S #4096 =X' & INDEV' *-3 =X' &INDEV A,S *+11 & BUFADR, X T +-19 &RECLTH 65 70 75 SET MAXIMUM RECORD LENGTH TEST INPUT DEVICE LOOP UNTIL READY READ CHARACTER INTO REG A TEST FOR END OF RECORD EXIT LOOP IF EOR STORE CHARACTER IN BUFFER LOOP UNLESS MAXIMUM LENGTH HAS BEEN REACHED SAVE RECORD LENGTH 80 85 WRBUFF &OUTDEV, &BUFADR, &RECLTH 90 95 100 105 110 115 120 125 MACRO TO WRITE RECORD FROM BUFFER CLEAR LOOP COUNTER 130 135 140 CLEAR LDT LDCH TD JE WD TLXR JLT MEND &RECLTH &BUFADR, X =X'&OUTDEV *-3 =X'&OUTDEV' T *-14 GET CHARACTER FROM BUFFER TEST OUTPUT DEVICE LOOP UNTIL READY WRITE CHARACTER LOOP UNTIL ALL CHARACTERS HAVE BEEN WRITTEN 145 MAIN PROGRAM 150 155 160 165 170 175 180 190 195 200 205 210 FIRST CLOOP STL RDBUFF LDA COMP JEQ WRBUFF J 215 ENDFIL 220 225 230 235 240 RETADR SAVE RETURN ADDRESS F1, BUFFER, LENGTH READ RECORD INTO BUFFER LENGTH TEST FOR END OF FILE #O ENDFIL EXIT IF EOF FOUND 05, BUFFER, LENGTH WRITE OUTPUT RECORD CLOOP LOOP 05, EOF, THREE INSERT EOF MARKER @RETADR C'EOF 3 1 1 LENGTH OF RECORD 4096 4096-BYTE BUFFER AREA FIRST WRBUFF J BYTE WORD RESW RESW RESB END EOF THREE RETADR LENGTH BUFFER 245 250 255 Figure 4.1 Use of macros in a SIC/XE program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started