Trailing-Edge
-
PDP-10 Archives
-
BB-H311B-RM
-
rsx20f-swskit/listings/slp.lis
There are no other files named slp.lis in the archive.
CMPRS MACRO M1108 05-DEC-77 23:47 PAGE 2
1 .TITLE CMPRS
2 .IDENT /04/
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 04
21 ;
22 ; D.N. CUTLER 4-JAN-72
23 ;
24 ; COMPRESS LINE
25 ;
26 ; LOCAL MACROS
27 ;
28 ; JUMP ON NO DIGIT
29 ;
30 ; JOND ADDR
31 ;
32 ; ADDR=ADDRESS TO JUMP TO IF NO DIGIT
33 ;
34 ;
35
36 .MACRO JOND ADDR
37 MOVB (R1)+,R5
38 CMPB R3,R5
39 BGT ADDR
40 CMPB R4,R5
41 BLT ADDR
42 .ENDM
43
44 ;
45 ; JUMP ON NO LETTER
46 ;
47 ; JONL ADDR
48 ;
49 ; ADDR=ADDRESS TO JUMP TO IF NO MATCH
50 ;
51
52 .MACRO JONL ADDR
53 MOVB (R1)+,R5
54 CMPB (R4)+,R5
55 BNE ADDR
56 .ENDM
57
CMPRS MACRO M1108 05-DEC-77 23:47 PAGE 2-1
58 ;
59 ; LOCAL DATA
60 ;
61
62 000000 000 011 040 CNTRL: .BYTE 0,11,' ,';,'*,'*,'-,'E,'W,'*,'*;
000003 073 052 052
000006 055 105 127
000011 052 052
63 .EVEN
64
65 ;+
66 ; **-$CMPRS-COMPRESS LINE
67 ;
68 ; THIS ROUTINE COMPRESSES THE LINE IN $LNBUF AND APPENDS ";**-DDDD" IF
69 ; APPROPRIATE. THE LINE IS SCANNED AND TRAILING BLANKS, HORIZONAL TABS,
70 ; AND ";**NEW**" OR ";**-DDDD" ARE DELETED. IF A LINE DELETION (I.E.
71 ; -N,M) HAS NOT YET BEEN EDITED ($LNDEL NONZERO), THEN THE LINE IS
72 ; PADDED TO THE RIGHT MARGIN AND ";**-" IS APPENDED. $LNDEL IS CONVERTED
73 ; TO ASCII AND APPENDED IMMEDIATELY FOLLOWING THE "-".
74 ;
75 ; INPUTS:
76 ;
77 ; LINE IN $LNBUF.
78 ;
79 ; OUTPUTS:
80 ;
81 ; THE LINE IN $LNBUF IS COMPRESSED AND $LNDEL IS SET TO ZERO.
82 ;-
83
84 000014 $CMPRS::SAVRG ;SAVE NONVOLITILE REGISTERS
85 000020 012701 000000G MOV #$LNBUF,R1 ;GET ADDRESS OF LINE BUFFER
86 000024 010100 1$: MOV R1,R0 ;SAVE ADDRESS OF NEXT BYTE
87 000026 112105 2$: MOVB (R1)+,R5 ;GET NEXT BYTE
88 000030 012704 000000' 3$: MOV #CNTRL,R4 ;GET ADDRESS OF CONTROL BYTE STRING
89 000034 JOL 8$ ;0?
90 000040 JOL 2$ ;HT?
91 000044 JOL 2$ ;SPACE?
92 000050 122405 CMPB (R4)+,R5 ;";"?
93 000052 001364 BNE 1$ ;IF NE NO
94 000054 JONL 7$ ;"*"?
95 000062 JONL 7$ ;"*"?
96 000070 JONL 4$ ;"-"?
97 000076 012703 000060 MOV #'0,R3 ;SET LOW LIMIT
98 000102 012704 000071 MOV #'9,R4 ;SET HIGH LIMIT
99 000106 JOND 7$ ;DIGIT?
100 000120 JOND 6$ ;DIGIT?
101 000132 JOND 6$ ;DIGIT?
102 000144 JOND 6$ ;DIGIT?
103 000156 000417 BR 5$ ;
104 000160 122705 000116 4$: CMPB #'N,R5 ;"N"?
105 000164 001017 BNE 7$ ;IF NE NO
106 000166 JONL 7$ ;"E"?
107 000174 JONL 7$ ;"W"?
108 000202 JONL 7$ ;"*"?
109 000210 JONL 7$ ;"*"?
110 000216 112105 5$: MOVB (R1)+,R5 ;GET NEXT BYTE
111 000220 105705 6$: TSTB R5 ;ZERO BYTE?
CMPRS MACRO M1108 05-DEC-77 23:47 PAGE 2-2
112 000222 001402 BEQ 8$ ;IF EQ YES
113 000224 105741 7$: TSTB -(R1) ;BACK UP BYTE ADDRESS
114 000226 000676 BR 1$ ;GO AGAIN
115 000230 005767 000000G 8$: TST $LNDEL ;ANYTHING TO DELETE?
116 000234 001435 BEQ 12$ ;IF EQ NO
117 000236 005001 CLR R1 ;CLEAR HORIZONAL POSITION
118 000240 012702 000000G MOV #$LNBUF,R2 ;GET ADDRESS OF LINE BUFFER
119 000244 020200 9$: CMP R2,R0 ;ANY MORE TO SCAN?
120 000246 103011 BHIS 11$ ;IF HIS NO
121 000250 122227 000011 CMPB (R2)+,#11 ;HORIZONAL TAB?
122 000254 001004 BNE 10$ ;IF NE NO
123 000256 042701 000007 BIC #7,R1 ;CLEAR EXCESS BITS
124 000262 062701 000007 ADD #7,R1 ;CALCULATE NEXT TAB STOP
125 000266 005201 10$: INC R1 ;INCREMENT HORIZONAL POSITION
126 000270 000765 BR 9$ ;
127 000272 11$: CALL $PADLN ;PAD LINE TO RIGHT MARGIN
128 000276 012704 000003' MOV #CNTRL+3,R4 ;APPEND PART OF SUFFIX
129 000004 .REPT 4
130 MOVB (R4)+,(R0)+ ;
131 .ENDR
132 000312 016701 000000G MOV $LNDEL,R1 ;GET NUMBER OF LINES DELETED
133 000316 005002 CLR R2 ;SUPPRESS ZEROS
134 000320 CALL $CBDMG ;CONVERT TO DECIMAL
135 000324 005067 000000G CLR $LNDEL ;ZERO NUMBER OF LINES DELETED
136 000330 105010 12$: CLRB (R0) ;SET ZERO SENTINEL BYTE
137 000332 162700 000000G SUB #$LNBUF,R0 ;CALCULATE LENGTH OF LINE
138 000336 010067 000000G MOV R0,$LNDES ;SET LENGTH FO LINE IN BYTES
139 000342 RETURN ;
140
141 000001 .END
CMPRS MACRO M1108 05-DEC-77 23:47 PAGE 2-3
SYMBOL TABLE
CNTRL 000000R $CMPRS 000014RG $LNDEL= ****** GX $PADLN= ****** GX $$ = 000001
$CBDMG= ****** GX $LNBUF= ****** GX $LNDES= ****** GX $SAVRG= ****** GX
. ABS. 000000 000
000344 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 545 WORDS ( 3 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:07
[61,10]CMPRS,[61,20]CMPRS/-SP=[61,30]MACFL,CMPRS
ERSLP MACRO M1108 05-DEC-77 23:47 PAGE 2
1 .TITLE ERSLP
2 .IDENT /05/ ; CM001
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 05 ; CM001
21 ;
22 ; D.N. CUTLER 8-JAN-73
23 ;
24 ; MODIFICATIONS:
25 ;
26 ; C. MONIA 17-SEP-75
27 ;
28 ; CM001 -- ENHANCE LINE LOCATION, ADD USER AUDIT TRAIL
29 ;
30 ;
31 ; ERROR MESSAGE ROUTINE
32 ;
33 ; EQUATED SYMBOLS
34 ;
35
36 000000 S$V0==0 ;SEV 0=DIAGNOSTIC MESSAGE
37 000001 S$V1==1 ;SEV 1=DIAG IF TERM IN/FATAL IF NOT
38 000002 S$V2==2 ;SEV 2=FATAL ERROR
39
40 ;
41 ; MACRO LIBRARY CALLS
42 ;
43
44 .MCALL DIR$,CLOSE$,QIO$,RCML$,WTSE$S
45
46 ;
47 ; LOCAL MACROS
48 ;
49 ; ERROR MESSAGE DEFINITION
50 ;
51 ; ERM NUM,FORMAT
52 ;
53 ; WHERE:
54 ;
55 ; NUM=ERROR NUMBER.
56 ; FORMAT=ERROR MESSAGE FORMAT STATEMENT.
57 ;
ERSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-1
58
59 .MACRO ERM NUM,FORMAT
60 E$R'NUM==NUM'.
61 .PSECT TXT
62 $$=.
63 .ASCIZ ?FORMAT?
64 .PSECT ER
65 .=ERMSG+<2*NUM'.>
66 .WORD $$
67 .PSECT
68 .ENDM
69
70 ;
71 ; LOCAL DATA
72 ;
73
74 000000 ARGBK: .BLKW 3 ;LOCAL ARGUMENT BLOCK
75 000006 MGQIO: QIO$ IO.WVB,2,1,,,,<,,40> ; MESSAGE OUTPUT DPB ; CM001
76 000000 .PSECT TXT
77 000000 045 116 123 DIAG: .ASCIZ /%NSLP -- *DIAG*-/ ; DIAGNOSTIC PREFIX ; CM001
000003 114 120 040
000006 055 055 040
000011 052 104 111
000014 101 107 052
000017 055 000
78 000000 .PSECT ER
79 000000 ERMSG: ;REF LABEL
80 000000 ERM 0,^*OPEN FAILURE CORRECTION INPUT FILE %X*
81 000030 ERM 1,^*OPEN FAILURE LINE LISTING FILE %X*
82 000030 ERM 2,^*OPEN FAILURE SOURCE OUTPUT FILE %X*
83 000030 ERM 3,^*PREMATURE EOF CORRECTION INPUT FILE %X*
84 000030 ERM 4,^*ILLEGAL GET COMMAND LINE ERROR CODE*
85 000030 ERM 5,^*I/O ERROR COMMAND INPUT FILE*
86 000030 ERM 6,^*INDIRECT FILE OPEN FAILURE%N%VA*
87 000030 ERM 7,^*INDIRECT COMMAND SYNTAX ERROR%N%VA*
88 000030 ERM 8,^*INDIRECT FILE DEPTH EXCEEDED%N%VA*
89 000030 ERM 9,^*I/O ERROR SOURCE OUTPUT FILE %X*
90 000030 ERM 10,^*I/O ERROR LINE LISTING FILE %X*
91 000030 ERM 11,^*ILLEGAL SWITCH%N%VA*
92 000030 ERM 12,^*ILLEGAL FILENAME%N%VA*
93 000030 ERM 13,^*ILLEGAL DEVICE NAME%N%VA*
94 000030 ERM 14,^*COMMAND SYNTAX ERROR%N%VA*
95 000030 ERM 15,^*PREMATURE EOF COMMAND INPUT FILE*
96 000030 ERM 16,^*I/O ERROR CORECTION INPUT FILE %X*
97 000030 ERM 17,^*ILLEGAL DIRECTORY%N%VA*
98 000030 ERM 18,^*I/O ERROR COMMAND OUTPUT FILE*
99 000030 ERM 19,^*ILLEGAL ERROR/SEVERITY CODE %P %P %P*
100 000030 ERM 20,^*LINE NUMBER ERROR%N%VA*
101 000052 .PSECT ER
102 000052 ERMSGE: ;REF LABEL
103 001231 .PSECT TXT
104 001231 045 116 123 FATAL: .ASCIZ /%NSLP -- *FATAL*-/ ; FATAL PREFIX ; CM001
001234 114 120 040
001237 055 055 040
001242 052 106 101
001245 124 101 114
001250 052 055 000
ERSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-2
105 001253 045 062 116 CMID: .ASCIZ /%2N%VA%N/
001256 045 126 101
001261 045 116 000
106 000030 .PSECT
107
108 ;+
109 ; **-$ERMSG-ERROR MESSAGE ROUTINE
110 ;
111 ; THIS ROUTINE IS CALLED TO OUTPUT AN ERROR MESSAGE. THE SEVERITY OF
112 ; THE ERROR IS USED TO SELECT A PREFIX THAT IS TO BE OUTPUT WITH THE
113 ; MESSAGE. THE ERROR NUMBER SPECIFIES AN ERROR FORMAT WHICH IS PASSED
114 ; TO $EDMSG TO EDIT THE ERROR MESSAGE. THE RESULTANT ERROR MESSAGE IS
115 ; THEN OUTPUT USING THE ROUTINE ERROR$. IF THE SEVERITY OF THE ERROR
116 ; IS 2, AB$RT IS SET, OR THE SEVERITY OF THE ERROR IS 1 AND THE INPUT IS
117 ; NOT COMMING FROM A TERMINAL, THEN THE CURRENT EDIT IS TERMINATED. ELSE
118 ; A RETURN TO THE CALLER IS EXECUTED.
119 ;
120 ; INPUTS:
121 ;
122 ; R1=ERROR/SEVERITY NUMBERS.
123 ; R2=ARGUMENT BLOCK ADDRESS.
124 ;
125 ; OUTPUTS:
126 ;
127 ; IF THE SEVERITY OF THE ERROR IS FATAL, THEN THE CURRENT EDIT
128 ; IS TERMINATED BY A JUMP TO $RSTRT.
129 ;-
130
131 000030 $ERMSG::SAVRG ;SAVE NONVOLITILE REGISTERS
132 000034 005005 10$: CLR R5 ;
133 000036 150105 BISB R1,R5 ;GET ERROR NUMBER
134 000040 005004 CLR R4 ;
135 000042 000301 SWAB R1 ;SWAP HALVES
136 000044 150104 BISB R1,R4 ;GET SEVERITY
137 000046 020527 000025 CMP R5,#<ERMSGE-ERMSG>/2;LEGAL ERROR NUMBER?
138 000052 002007 BGE 20$ ;IF GE NO
139 000054 020427 000002 CMP R4,#S$V2 ;LEGAL SEVERITY?
140 000060 003004 BGT 20$ ;IF GT NO
141 000062 006305 ASL R5 ;CONVERT ERROR NUMBER TO INDEX
142 000064 005765 000000' TST ERMSG(R5) ;ANY MESSAGE THIS NUMBER?
143 000070 001013 BNE 30$ ;IF NE YES
144 000072 012700 000004' 20$: MOV #ARGBK+4,R0 ;GET ADDRESS OF ARGUMENT BLOCK
145 000076 016610 000010 MOV 10(SP),(R0) ;STORE ADDRESS OF CALLER
146 000102 010240 MOV R2,-(R0) ;STORE ARGUMENT BLOCK ADDRESS
147 000104 000301 SWAB R1 ;RESTORE R1
148 000106 010140 MOV R1,-(R0) ;STORE ERROR,SEVERITY
149 000110 010002 MOV R0,R2 ;SET ARGUMENT BLOCK ADDRESS
150 000112 012701 MOV (PC)+,R1 ;GET ERROR,SEVERITY
151 000114 023 002 .BYTE E$R19,S$V2 ;FATAL-NO RETURN
152 000116 000746 BR 10$ ;GO AROUND AGAIN
153 000120 016703 000000G 30$: MOV $CMIPT,R3 ;GET COMMAND INPUT RECORD BLOCK
154 000124 132763 000000G 000000G BITB #FD.TTY,F.RCTL(R3);TERMINAL DEVICE?
155 000132 005204 INC R4 ;INCREMENT SEVERITY
156 000134 012701 000000' 40$: MOV #DIAG,R1 ;ASSUME DIAGNOSTIC MESSAGE
157 000140 020427 000002 CMP R4,#2 ;FATAL ERROR?
158 000144 002402 BLT 50$ ;IF LT NO
159 000146 012701 001231' MOV #FATAL,R1 ;GET ADDRESS OF FATAL MESSAGE
ERSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-3
160 000152 012700 000000G 50$: MOV #$OUTBF,R0 ;GET ADDRESS OF OUTPUT BUFFER
161 000156 CALL $EDMSG ; FORMAT PREFIX ; CM001
162 000162 016501 000000' MOV ERMSG(R5),R1 ;GET ADDRESS OF FORMAT STATEMENT
163 000166 CALL $EDMSG ;EDIT MESSAGE
164 000172 010001 MOV R0,R1 ;COPY ENDING ADDRESS
165 000174 012700 000000G MOV #$OUTBF,R0 ;GET ADDRESS OF OUTPUT BUFFER
166 000200 160001 SUB R0,R1 ;CALCULATE LENGTH OF MESSAGE
167 000202 CALL $MGOUT ;OUTPUT ERROR MESSAGE
168 000206 103427 BCS 70$ ;IF CS I/O ERROR
169 000210 012701 001253' MOV #CMID,R1 ; GET CONTROL STRING ; CM001
170 000214 012702 000000G MOV #$HDSIZ,R2 ; GET FORMAT CONTROL BLOCK ; CM001
171 000220 005712 TST (R2) ; ANY STRING TO PRINT? ; CM001
172 000222 001415 BEQ 65$ ; IF EQ NO ; CM001
173 000224 012700 000000G MOV #$OUTBF,R0 ; GET OUTPUT BUFFER ADDRESS ; CM001
174 000230 CALL $EDMSG ; FORMAT STRING ; CM001
175 000234 010001 MOV R0,R1 ; COPY ENDING ADDRESS ; CM001
176 000236 012700 000000G MOV #$OUTBF,R0 ; GET BUFFER ADDRESS ; CM001
177 000242 160001 SUB R0,R1 ; COMPUTE MESSAGE LENGTH ; CM001
178 000244 162701 000006 SUB #6,R1 ; STRIP OFF CR-LF PAIRS
179 000250 CALL $MGOUT ; OUTPUT MESSAGE ; CM001
180 000254 103404 BCS 70$ ; IF C/S EXIT QUIETLY ; CM001
181 000256 65$: ; ; CM001
182 000256 020427 000002 CMP R4,#2 ;FATAL ERROR?
183 000262 002001 BGE 70$ ;IF GE YES
184 000264 RETURN ;
185
186 ;
187 ; FATAL ERROR-TERMINATE CURRENT EDIT
188 ;
189
190 000266 70$: CLOSE$ $CFIPT ;CLOSE CORRECTION INPUT FILE
191 000276 CLOSE$ $LSTPT ;CLOSE LINE LISTING FILE
192 000306 CLOSE$ $SRCPT ;CLOSE SOURCE OUTPUT FILE
193 000316 RCML$ $CMIPT ;RESET TO STACK LEVEL ZERO
194 000326 000167 000000G JMP $RSTRT ;RESTART
195 ;+ ; CM001
196 ; **-$MGOUT-SEND A MESSAGE TO THE TERMINAL DEVICE ; CM001
197 ; ; CM001
198 ; INPUTS: ; CM001
199 ; ; CM001
200 ; R0=BUFFER ADDRESS ; CM001
201 ; R1=BYTE COUNT ; CM001
202 ; ; CM001
203 ; OUTPUTS: ; CM001
204 ; ; CM001
205 ; C/CLEAR - MESSAGE TRANSMITTED TO DEVICE ASSIGNED TO LUN 2 ; CM001
206 ; ; CM001
207 ; C/SET - QIO DIRECTIVE ERROR (LUN UNASSIGNED) ; CM001
208 ; ; CM001
209 ;- ; CM001
210
211 000332 010067 177464 $MGOUT::MOV R0,MGQIO+Q.IOPL ; SETUP BUFFER ADDRESS ; CM001
212 000336 010167 177462 MOV R1,MGQIO+Q.IOPL+2 ; SETUP BYTE COUNT ; CM001
213 000342 DIR$ #MGQIO ; ISSUE QIO ; CM001
214 000350 103405 BCS 10$ ; IF C/S QIO FAILED ; CM001
215 000352 WTSE$S #1 ; WAIT ON EFN 1 ; CM001
216 000364 10$: RETURN ; ; CM001
ERSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-4
217
218
219 000001 .END
ERSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-5
SYMBOL TABLE
ARGBK 000000R E$R15 = 000017 G E$R8 = 000010 G Q.IOPL= 000014 $LSTPT= ****** GX
CMID 001253R 002 E$R16 = 000020 G E$R9 = 000011 G Q.IOPR= 000007 $MGOUT 000332RG
DIAG 000000R 002 E$R17 = 000021 G FATAL 001231R 002 Q.IOSB= 000010 $OUTBF= ****** GX
ERMSG 000000R 003 E$R18 = 000022 G FD.TTY= ****** GX S$V0 = 000000 G $RSTRT= ****** GX
ERMSGE 000052R 003 E$R19 = 000023 G F.RCTL= ****** GX S$V1 = 000001 G $SAVRG= ****** GX
E$R0 = 000000 G E$R2 = 000002 G IO.WVB= ****** GX S$V2 = 000002 G $SRCPT= ****** GX
E$R1 = 000001 G E$R20 = 000024 G MGQIO 000006R $CFIPT= ****** GX $$ = 000001
E$R10 = 000012 G E$R3 = 000003 G PAR$$$= 000067 $CMIPT= ****** GX $$$ARG= 000011
E$R11 = 000013 G E$R4 = 000004 G Q.IOAE= 000012 $EDMSG= ****** GX $$$OST= 000014
E$R12 = 000014 G E$R5 = 000005 G Q.IOEF= 000006 $ERMSG 000030RG .CLOSE= ****** G
E$R13 = 000015 G E$R6 = 000006 G Q.IOFN= 000002 $HDSIZ= ****** GX .GCML2= ****** G
E$R14 = 000016 G E$R7 = 000007 G Q.IOLU= 000004
. ABS. 000000 000
000366 001
TXT 001264 002
ER 000052 003
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 1909 WORDS ( 8 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:22
[61,10]ERSLP,[61,20]ERSLP/-SP=[61,30]MACFL,ERSLP
GETLN MACRO M1108 05-DEC-77 23:47 PAGE 2
1 .TITLE GETLN
2 .IDENT /05/ ; CM001
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 05 ; CM001
21 ;
22 ; D.N. CUTLER 15-OCT-72
23 ;
24 ; MODIFICATIONS:
25 ;
26 ; C. MONIA 17-SEP-75
27 ;
28 ; CM001 -- ADD ENHANCED LINE LOCATION, USER AUDIT TRAILS
29 ;
30 ;
31 ; GET LINE FROM INPUT FILE
32 ;
33 ; EQUATED SYMBOLS
34 ;
35
36 ;
37 ; LOCAL DATA
38 ;
39
40 000000 .PSECT $$LNB0,D
41
42 000000 $LNDES::.BLKW 1 ;NUMBER OF CHARACTERS IN LINE
43 000002 000012' .WORD $LNBUF ;ADDRESS OF LINE
44 000004 $LINHD::.BLKW 2 ;LINE HEADER
45 000010 056 011 .BYTE '.,11 ;
46 000012 $LNBUF::.BLKB 4 ; CM001
47
48 000000 .PSECT
49
50 ;+
51 ; **-$GETLN-GET LINE FROM INPUT FILE
52 ;
53 ; THIS ROUTINE IS CALLED TO MOVE A RECORD FROM AN INPUT FILE RECORD BUF-
54 ; FER TO $LNBUF. AS THE RECORD IS MOVED, HORIZONAL FORMATING IS CALCULATED.
55 ; ALL CHARACTERS CAUSING HORIZONAL FORMATING TO EXCEED THE RIGHT MARGIN ARE
56 ; IGNORED.
57 ;
GETLN MACRO M1108 05-DEC-77 23:47 PAGE 2-1
58 ; INPUTS:
59 ;
60 ; R0=ADDRESS OF BYTE COUNT,BUFFER ADDRESS DOUBLEWORD.
61 ;
62 ; OUTPUTS:
63 ;
64 ; R0=ADDRESS OF SENTINEL BYTE IN $LNBUF.
65 ; R1=HORIZONAL POSITION OF NEXT CHARACTER.
66 ; $LNDES CONTAINS BYTE COUNT OF RECORD IN $LNBUF.
67 ;-
68
69 000000 $GETLN::SAVRG ;SAVE NONVOLITILE REGISTERS
70 000004 012003 MOV (R0)+,R3 ;GET BYTE COUNT
71 000006 011002 MOV (R0),R2 ;GET ADDRESS OF RECORD BUFFER
72 000010 005001 CLR R1 ;CLEAR HORIZONAL POSITION
73 000012 012700 000012' MOV #$LNBUF,R0 ;GET ADDRESS OF LINE BUFFER
74 000016 005303 1$: DEC R3 ;ANY MORE IN LINE?
75 000020 002424 BLT 4$ ;IF LT NO
76 000022 112205 MOVB (R2)+,R5 ;GET NEXT BYTE IN LINE
77 000024 122705 000011 CMPB #11,R5 ;HORIZONAL TAB?
78 000030 001012 BNE 2$ ;IF NE NO
79 000032 010104 MOV R1,R4 ;GET CURRENT HORIZONAL POSITION
80 000034 042704 000007 BIC #7,R4 ;CLEAR LOW BITS
81 000040 062704 000010 ADD #10,R4 ;CALCULATE NEXT TAB STOP
82 000044 020427 000001G CMP R4,#L$LGTH+1 ;ANY HORIZONAL ROOM LEFT?
83 000050 002362 BGE 1$ ;IF GE NO
84 000052 010401 MOV R4,R1 ;SET NEW HORIZONAL POSITION
85 000054 000404 BR 3$ ;
86 000056 020127 000000G 2$: CMP R1,#L$LGTH ;ANY HORIZONAL ROOM LEFT?
87 000062 002355 BGE 1$ ;IF GE NO
88 000064 005201 INC R1 ;INCREMENT HORIZONAL POSITION
89 000066 110520 3$: MOVB R5,(R0)+ ;STORE BYTE IN LINE BUFFER
90 000070 000752 BR 1$ ;GO AGAIN
91 000072 105010 4$: CLRB (R0) ;SET SENTINEL BYTE
92 000074 010002 MOV R0,R2 ;COPY ADDRESS OF SENTINEL BYTE
93 000076 162702 000012' SUB #$LNBUF,R2 ;CALCULATE LENGTH OF LINE
94 000102 010267 000000' MOV R2,$LNDES ;SET LENGTH OF LINE IN BYTES
95 000106 7$: RETURN ;
96
97 000001 .END
GETLN MACRO M1108 05-DEC-77 23:47 PAGE 2-2
SYMBOL TABLE
L$LGTH= ****** GX $LINHD 000004RG 002 $LNBUF 000012RG 002 $LNDES 000000RG 002 $SAVRG= ****** GX
$GETLN 000000RG
. ABS. 000000 000
000110 001
$$LNB0 000016 002
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 381 WORDS ( 2 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:04
[61,10]GETLN,[61,20]GETLN/-SP=[61,30]MACFL,GETLN
GTSLP MACRO M1108 05-DEC-77 23:47 PAGE 2
1 .TITLE GTSLP
2 .IDENT /04/ ; CM001
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 04 ; CM001
21 ;
22 ; D.N. CUTLER 26-JAN-73
23 ;
24 ; MODIFICATIONS:
25 ;
26 ; C. MONIA 11-SEP-75
27 ;
28 ; CM001 -- ADD USER-SPECIFIED AUDIT TRAIL
29 ;
30 ; GET COMMAND INPUT LINE
31 ;
32 ; MACRO LIBRARY CALLS
33 ;
34
35 .MCALL GCML$
36
37 ;
38 ; LOCAL DATA
39 ;
40
41 000000 015 012 NOPMT: .BYTE 15,12 ;NO PROMPT STRING
42 .EVEN
43
44 ;+
45 ; **-$GTCML-GET COMMAND INPUT LINE
46 ;
47 ; THIS ROUTINE CALLS THE SYSTEM LIBRARY ROUTINE .GCML TO READ THE NEXT
48 ; RECORD FROM THE COMMAND INPUT FILE. IF SPECIFIED, ";**NEW**" IS AP-
49 ; PENDED TO THE LINE IMMEDIATELY AFTER THE SELECTED RIGHT MARGIN (I.E.
50 ; 73-80 FOR 72 RIGHT MARGIN).
51 ;
52 ; INPUTS:
53 ;
54 ; NONE.
55 ;
56 ; OUTPUTS:
57 ;
GTSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-1
58 ; C=1 IF END OF FILE OR ERROR ON RECORD READ.
59 ; C=0 IF REQUEST IS SUCESSFUL.
60 ;-
61
62 000002 016700 000000G $GTCML::MOV $CMIPT,R0 ;GET COMMAND BLOCK ADDRESS
63 000006 005001 CLR R1 ;ASSUME PROMPTING IS REQUIRED
64 000010 005002 CLR R2 ;
65 000012 152760 000001 000141 BISB #GE.COM,G.MODE(R0);DISCARD COMMENT LINES
66 000020 005767 000000G TST $CMFLG ;PROMPT?
67 000024 001407 BEQ 10$ ;IF EQ YES
68 000026 012701 000000' MOV #NOPMT,R1 ;SET FOR NO PROMPT
69 000032 012702 000002 MOV #2,R2 ;
70 000036 142760 000001 000141 BICB #GE.COM,G.MODE(R0);LET COMMENT LINES COME THROUGH
71 000044 10$: GCML$ R0,R1,R2 ;GET A COMMAND LINE
72 000060 103423 BCS GTCML1 ;IF CS EOF OR ERROR
73 000062 062700 000146 ADD #G.CMLD,R0 ;POINT TO LINE DESCRIPTOR
74 000066 CALL $GETLN ;MOVE COMMAND LINE TO LINE BUFFER
75 000072 032767 000000G 000000G BIT #AP$ND,$SWTCH ;APPEND ";**NEW**"?
76 000100 001012 BNE 30$ ;IF NE NO
77 000102 CALL $PADLN ;PAD LINE TO RIGHT MARGIN
78 000106 012701 000000G MOV #$NEW,R1 ;GET ADDRESS OF SUFFIX STRING ; CM001
79 000112 112120 20$: MOVB (R1)+,(R0)+ ;MOVE STRING TO LINE BUFFER
80 000114 001376 BNE 20$ ;IF NE MOVE ANOTHER BYTE
81 000116 162700 000001G SUB #$LNBUF+1,R0 ;CALCULATE LENGTH OF LINE
82 000122 010067 000000G MOV R0,$LNDES ;SET LENGTH OF LINE IN BYTES
83 000126 30$: RETURN ;
84
85 ;
86 ; EOF OR ERROR
87 ;
88
89 000130 116002 000140 GTCML1: MOVB G.ERR(R0),R2 ;GET ERROR CODE
90 000134 122702 177766 CMPB #GE.EOF,R2 ;EOF?
91 000140 001433 BEQ GTCML2 ;IF EQ YES
92 000142 012701 MOV (PC)+,R1 ;ASSUME I/O ERROR
93 000144 000G 000G .BYTE E$R5,S$V0 ;DIAGNOSTIC
94 000146 122702 177777 CMPB #GE.IOR,R2 ;I/O ERROR?
95 000152 001421 BEQ 10$ ;IF EQ YES
96 000154 012701 MOV (PC)+,R1 ;ASSUME OPEN FAILURE
97 000156 000G 000G .BYTE E$R6,S$V2 ;FATAL-NO RETURN
98 000160 122702 177776 CMPB #GE.OPR,R2 ;OPEN FAILURE?
99 000164 001414 BEQ 10$ ;IF EQ YES
100 000166 012701 MOV (PC)+,R1 ;ASSUME BAD FILENAME
101 000170 000G 000G .BYTE E$R7,S$V2 ;FATAL-NO RETURN
102 000172 122702 177775 CMPB #GE.BIF,R2 ;BAD FILENAME?
103 000176 001407 BEQ 10$ ;IF EQ YES
104 000200 012701 MOV (PC)+,R1 ;ASSUME MAX DEPTH EXCEEDED
105 000202 000G 000G .BYTE E$R8,S$V2 ;FATAL-NO RETURN
106 000204 122702 177774 CMPB #GE.MDE,R2 ;MAX DEPTH EXCEEDED?
107 000210 001402 BEQ 10$ ;IF EQ YES
108 000212 012701 MOV (PC)+,R1 ;ILLEGAL ERROR CODE
109 000214 000G 000G .BYTE E$R4,S$V2 ;FATAL-NO RETURN
110 000216 010002 10$: MOV R0,R2 ;COPY ADDRESS OF GET LINE COMMAND BLOCK
111 000220 062702 000146 ADD #G.CMLD,R2 ;POINT TO LINE DESCRIPTOR
112 000224 CALL $ERMSG ;OUTPUT ERROR MESSAGE
113 000230 000261 GTCML2: SEC ;SET CARRY
114 000232 RETURN ;
GTSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-2
115
116 000001 .END
GTSLP MACRO M1108 05-DEC-77 23:47 PAGE 2-3
SYMBOL TABLE
AP$ND = ****** GX GE.IND= 000002 G.ISIZ= 000020 S.FNB = 000036 $GTCML 000002RG
E$R4 = ****** GX GE.IOR= 177777 G.MODE= 000141 S.FNBW= 000017 $LNBUF= ****** GX
E$R5 = ****** GX GE.LC = 000010 G.PSDS= 000142 S.FNTY= 000004 $LNDES= ****** GX
E$R6 = ****** GX GE.MDE= 177774 NOPMT 000000R S.FTYP= 000002 $NEW = ****** GX
E$R7 = ****** GX GE.OPR= 177776 PAR$$$= 000000 S.NFEN= 000020 $PADLN= ****** GX
E$R8 = ****** GX GTCML1 000130R S$V0 = ****** GX $CMFLG= ****** GX $SWTCH= ****** GX
GE.BIF= 177775 GTCML2 000230R S$V2 = ****** GX $CMIPT= ****** GX $$ = 000001
GE.CLO= 000004 G.CMLD= 000146 S.FDB = 000140 $ERMSG= ****** GX .GCML1= ****** G
GE.COM= 000001 G.DPRM= 000160 S.FNAM= 000006 $GETLN= ****** GX ...TPC= 000140
GE.EOF= 177766 G.ERR = 000140
. ABS. 000000 000
000234 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 1945 WORDS ( 8 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:16
[61,10]GTSLP,[61,20]GTSLP/-SP=[61,30]MACFL,GTSLP
IOSLP MACRO M1108 05-DEC-77 23:48 PAGE 2
1 .TITLE IOSLP
2 .IDENT /04/
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 04 ; CM001
21 ;
22 ; D.N. CUTLER 26-JAN-73
23 ;
24 ; MODIFICATIONS:
25 ;
26 ; C. MONIA 11-SEP-75
27 ;
28 ; CM001 -- ADD USER-SPECIFIED AUDIT TRAIL
29 ;
30 ; MONITOR DEPENDENT I/O DATA BASE
31 ;
32 ; EQUATED SYMBOLS
33 ;
34
35 000006 F$DEVL==6. ;MAX LENGTH OF DEVICE NAME
36 000013 F$DIRL==11. ;MAX LENGTH OF DIRECTORY NAME
37 000021 F$FILL==17. ;MAX LENGTH OF FILENAME
38
39 ;
40 ; MACRO LIBRARY CALLS
41 ;
42
43 .MCALL CSI$ND,CSI$SV,CSI$SW,FDAT$A,FDOP$A ; CM001
44 .MCALL FDRC$A,FSRSZ$,GCMLB$,NMBLK$ ; CM001
45
46 ;
47 ; LOCAL MACROS
48 ;
49 ; CLOSE SWITCH P-SECTION
50 ;
51 ; A=FIRST THREE CHARACTER OF BLOCK NAME.
52 ;
53
54 .MACRO CLOSCT A
55 .PSECT A'SWT,D,GBL
56 CSI$ND
57 .PSECT
IOSLP MACRO M1108 05-DEC-77 23:48 PAGE 2-1
58 .ENDM
59
60 ;
61 ; GENERATE CONTROL BLOCK
62 ;
63 ; GENBLK A,B,C,DD,E,F,G,H,I,J,K
64 ;
65 ; WHERE:
66 ;
67 ; A=FIRST THREE CHARACTERS OF BLOCK NAME.
68 ; B=RECORD TYPE.
69 ; C=RECORD ATTRIBUTES.
70 ; DD=RECORD SIZE.
71 ; E=RECORD ACCESS.
72 ; F=RECORD BUFFER SIZE.
73 ; G=LOGICAL UNIT.
74 ; H=FILE POINTER SWITCH.
75 ; I=DEFAULT FILE TYPE.
76 ; J=DEFAULT DEVICE NAME.
77 ; K=DEFAULT DEVICE UNIT.
78 ;
79
80 .MACRO GENBLK A,B,C,DD,E,F,G,H,I,J,K
81 .PSECT A'PT,D,GBL
82 $'A'PT::.WORD A'PT
83 A'PT: FDBDF$
84 FDAT$A B,C,DD
85 $$=0
86 .IF NB F
87 .PSECT A'BUF,D,GBL
88 $$=.
89 .BLKB F
90 .PSECT A'PT,D,GBL
91 .ENDC
92 FDRC$A E,$$,F
93 .PSECT A'NAM,D,GBL
94 $$=.
95 NMBLK$ ,I,,J,K
96 $$0=0
97 .IF NB H
98 .PSECT A'DV,D,GBL
99 $$1=.
100 .BLKB F$DEVL
101 .PSECT A'DR,D,GBL
102 $$2=.
103 .BLKB F$DIRL
104 .PSECT A'FL,D,GBL
105 $$3=.
106 .BLKB F$FILL
107 .PSECT A'FP,D,GBL
108 $$0=.
109 .BLKW 1
110 .WORD $$1
111 .BLKW 1
112 .WORD $$2
113 .BLKW 1
114 .WORD $$3
IOSLP MACRO M1108 05-DEC-77 23:48 PAGE 2-2
115 .ENDC
116 .PSECT A'PT,D,GBL
117 FDOP$A G,$$0,$$
118 R$NAME==.-A'PT
119 .WORD A'PT+F.FNB+N.FNAM
120 R$SWTH==.-A'PT
121 .BLKW 1
122 R$SWBK==.-A'PT
123 .WORD A'SW
124 .PSECT A'SWT,D,GBL
125 A'SW:
126 .PSECT
127 .ENDM
128
129
130 ;
131 ; GENERATE SWITCH CONTROL BLOCK
132 ;
133 ; GENSWT A,B,C,D,E,F,G
134 ;
135 ; A=FIRST THREE CHARACTERS OF RECORD BLOCK NAME.
136 ; B=A 2 CHARACTER SWITCH NAME.
137 ; C=SWITCH MASK.
138 ; DD=ADDRESS OF SWITCH WORD.
139 ; E=SWITCH MASK DISPOSITION.
140 ; F=NEGATE ENABLE.
141 ; G=SWITCH VALUE FLAG ; CM001
142 ;
143
144 .MACRO GENSWT A,B,C,DD,E,F,G
145 .PSECT A'SWT,D,GBL
146 .IF NB G
147 CSI$SW B,C,DD,E,F,B'SVT
148 .IFF
149 CSI$SW B,C,DD,E,F
150 .ENDC
151 .PSECT
152 .ENDM
153
154 ; ; CM001
155 ; GENERATE SWITCH VALUE TABLE ; CM001
156 ; ; CM001
157 ; GENSVT A,B,C,DD ; CM001
158 ;
159 ; A=SWITCH TYPE ; CM001
160 ; B=LOCATION TO RECEIVE SWITCH VALUE ; CM001
161 ; C=LENGTH OF SWITCH VALUE IN BYTES ; CM001
162 ; DD=OPTIONAL TWO-CHARACTER SWITCH NAME ; CM001
163 ; ; CM001
164 ; CM001
165 .MACRO GENSVT A,B,C,DD
166 .IF NB DD
167 .PSECT DD'SVT,D,GBL
168 DD'SVT=.
169 .ENDC
170 CSI$SV A,B,C
171 CSI$ND
IOSLP MACRO M1108 05-DEC-77 23:48 PAGE 2-3
172 .=.-2
173 .ENDM
174 ;
175 ; GET COMMAND INPUT CONTROL BLOCK
176 ;
177
178 000000 .PSECT CMIPT,D,GBL
179 000000 000002' $CMIPT::.WORD CMIPT ;POINTER TO CONTROL BLOCK
180 000002 CMIPT: GCMLB$ 2,SLP
181
182 ;
183 ; FILE CONTROL BLOCKS
184 ;
185
186 000430 GENBLK CFI,,,,4,88.,3,1,,SY
187 000000 GENBLK LST,2,2,94.,,,4,1,LST,SY
188 000000 GENBLK SRC,2,2,88.,,,5,1,,SY
189
190 ;
191 ; ALLOCATE FILE SERVICES STORAGE REGION
192 ;
193
194 000000 FSRSZ$ 4,<4*512.+90.>
195
196 ;
197 ; SWITCH CONTROL BLOCK DEFINITIONS
198 ;
199
200 000000 GENSWT CFI,AU,AP$ND,$SWTCH,CLEAR,NEG,1 ; CM001
201 000000 GENSWT CFI,BF,BL$NK,$SWTCH,CLEAR,NEG
202 000000 GENSWT LST,DB,DB$LL,$SWTCH,SET,NEG
203 000000 GENSWT LST,SP,SP$OL,$SWTCH,CLEAR,NEG
204 000000 GENSWT SRC,AU,AP$ND,$SWTCH,CLEAR,NEG,1 ; CM001
205 000000 GENSWT SRC,BF,BL$NK,$SWTCH,CLEAR,NEG
206
207 ; ; CM001
208 ; SWITCH VALUE TABLES ; CM001
209 ; ; CM001
210 ; CM001
211 000000 GENSVT NUMERIC,$PDSIZ,2,AU ; CM001
212 000004 GENSVT NUMERIC,$AULGH,2 ; CM001
213 ; CM001
214
215 ;
216 ; CLOSE SWITCH P-SECTIONS
217 ;
218
219 000010 CLOSCT CFI
220 000000 CLOSCT LST
221 000000 CLOSCT SRC
222
223 000001 .END
IOSLP MACRO M1108 05-DEC-77 23:48 PAGE 2-4
SYMBOL TABLE
AP$ND = ****** GX F.DFNB= 000046 F.RCNM= 000034 G.MODE= 000141 S.FNB = 000036
AUSVT = 000000R 032 F.DSPT= 000044 F.RCTL= 000017 G.PSDS= 000142 S.FNBW= 000017
BL$NK = ****** GX F.DVNM= 000134 F.RSIZ= 000002 LSTPT 000002R 013 S.FNTY= 000004
CFIPT 000002R 003 F.EFBK= 000010 F.RTYP= 000000 LSTSW 000000R 021 S.FTYP= 000002
CFISW 000000R 012 F.EFN = 000050 F.STBK= 000036 N.DID = 000024 S.NFEN= 000020
CMIPT 000002R 002 F.EOBB= 000032 F.UNIT= 000136 N.DVNM= 000032 $AULGH= ****** GX
DB$LL = ****** GX F.ERR = 000052 F.URBD= 000020 N.FID = 000000 $CFIPT 000000RG 003
FD.CCL= ****** GX F.FACC= 000043 F.VBN = 000064 N.FNAM= 000006 $CMIPT 000000RG 002
FD.REC= ****** GX F.FFBY= 000014 F.VBSZ= 000060 N.FTYP= 000014 $LSTPT 000000RG 013
FD.TTY= ****** GX F.FNAM= 000110 GE.BIF= 177775 N.FVER= 000016 $PDSIZ= ****** GX
F$DEVL= 000006 G F.FNB = 000102 GE.CLO= 000004 N.NEXT= 000022 $SRCPT 000000RG 022
F$DIRL= 000013 G F.FTYP= 000116 GE.COM= 000001 N.STAT= 000020 $SWTCH= ****** GX
F$FILL= 000021 G F.FVER= 000120 GE.EOF= 177766 N.UNIT= 000034 $$ = 000001
F.ALOC= 000040 F.HIBK= 000004 GE.IND= 000002 R$NAME= 000140 G $$$ = 000162R 002
F.BBFS= 000062 F.LUN = 000042 GE.IOR= 177777 R$SWBK= 000144 G $$0 = 000000R 027
F.BDB = 000070 F.MBCT= 000054 GE.LC = 000010 R$SWTH= 000142 G $$1 = 000000R 024
F.BGBC= 000057 F.MBC1= 000055 GE.MDE= 177774 SP$OL = ****** GX $$2 = 000000R 025
F.BKDN= 000026 F.MBFG= 000056 GE.OPR= 177776 SRCPT 000002R 022 $$3 = 000000R 026
F.BKDS= 000020 F.NRBD= 000024 G.CMLD= 000146 SRCSW 000000R 030 .FSRCB= ****** G
F.BKEF= 000050 F.NREC= 000030 G.DPRM= 000160 S.BFHD= 000020 ...PC1= 000002R 022
F.BKP1= 000051 F.OVBS= 000030 G.ERR = 000140 S.FATT= 000016 ...PC2= 000142R 022
F.BKST= 000024 F.RACC= 000016 G.ISIZ= 000020 S.FDB = 000140 ...PC3= 000002R 022
F.BKVB= 000064 F.RATT= 000001 G.LPDL= 000060 S.FNAM= 000006 ...TPC= 000020
F.CNTG= 000034
. ABS. 000000 000
000000 001
CMIPT 000430 002
CFIPT 000150 003
CFIBUF 000130 004
CFINAM 000036 005
CFIDV 000006 006
CFIDR 000013 007
CFIFL 000021 010
CFIFP 000014 011
CFISWT 000022 012
LSTPT 000150 013
LSTNAM 000036 014
LSTDV 000006 015
LSTDR 000013 016
LSTFL 000021 017
LSTFP 000014 020
LSTSWT 000022 021
SRCPT 000150 022
SRCNAM 000036 023
SRCDV 000006 024
SRCDR 000013 025
SRCFL 000021 026
SRCFP 000014 027
SRCSWT 000022 030
$$FSR1 004232 031
AUSVT 000012 032
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 4265 WORDS ( 17 PAGES)
DYNAMIC MEMORY: 5216 WORDS ( 20 PAGES)
ELAPSED TIME: 00:00:50
[61,10]IOSLP,[61,20]IOSLP/-SP=[61,30]MACFL,IOSLP
OD2CT - CONVERT FROM ASCII TO T MACRO M1108 05-DEC-77 23:48 PAGE 1
1 .TITLE OD2CT - CONVERT FROM ASCII TO TWO BINARY WORDS
2
3 .IDENT "V0002"
4 ;
5 ;
6 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20
21 ;
22 ; ANDREW C. GOLDSTEIN 10 JUL 1974
23 ;
24 .MCALL RETURN
25
26 .MACRO SAVR1
27 JSR R5,.SAVR1
28 .ENDM SAVR1
OD2CT - CONVERT FROM ASCII TO T MACRO M1108 05-DEC-77 23:48 PAGE 2
30 ;+
31 ;
32 ; *** - .DD2CT CONVERT A DECIMAL NUMBER TO TWO BINARY WORDS.
33 ; THIS SUBROUTINE CONVERTS AN ASCII DECIMAL NUMBER STRING
34 ; TO A DOUBLE LENGTH BINARY NUMBER. A TRAILING DECIMAL
35 ; POINT IS PERMITTED.
36 ;
37 ; *** - .OD2CT CONVERT AN OCTAL OR DECIMAL NUMBER TO TWO BINARY WORDS.
38 ; THIS SUBROUTINE CONVERTS AN ASCII OCTAL OR DECIMAL
39 ; NUMBER STRING TO A DOUBLE LENGTH BINARY NUMBER. RADIX
40 ; IS CONTROLLED BY THE PRESENCE OR ABSENCE OF A TRAILING
41 ; DECIMAL POINT.
42 ;
43 ; BOTH ENTRIES ACCEPT A LEADING "+" OR "-" AND PRODUCE A TWO'S
44 ; COMPLEMENT NEGATIVE FOR THE LATTER.
45 ;
46 ; INPUT:
47 ; R3 - ADDRESS OF TWO WORD FIELD TO HOLD CONVERTED NUMBER
48 ; WORD 1 - HIGH ORDER 16 BITS
49 ; WORD 2 - LOW ORDER 16 BITS
50 ; R4 - CHARACTER COUNT OF STRING
51 ; R5 - ADDRESS OF STRING
52 ;
53 ; OUTPUT:
54 ;
55 ; CC-C
56 ; CLEAR - SUCCESSFUL CONVERSION
57 ; SET - ILLEGAL CHARACTERS IN STRING
58 ;
59 ; ALL REGISTERS ARE PRESERVED
60 ;
61 ;-
62
63 .ENABL LSB
64
65 000000 .DD2CT::SAVR1 ; SAVE REGISTERS
66 000004 012701 000012 MOV #10.,R1 ; SET UP FOR DECIMAL RADIX ONLY
67 000010 000404 BR 10$
68
69 000012 .OD2CT::SAVR1 ; SAVE REGISTERS
70 000016 012701 000010 MOV #8.,R1 ; SET UP FOR OCTAL RADIX
71
72 000022 010502 10$: MOV R5,R2 ; COPY THE STRING POINTER
73 000024 060402 ADD R4,R2 ; POINT TO END OF STRING
74 000026 124227 000056 CMPB -(R2),#'. ; LOOK FOR TRAILING DECIMAL POINT
75 000032 001003 BNE 20$ ; NO
76 000034 012701 000012 MOV #10.,R1 ; YES - SET DECIMAL
77 000040 005304 DEC R4 ; REMOVE "." FROM STRING
78
79 000042 005046 20$: CLR -(SP) ; CLEAR NEGATIVE FLAG
80 000044 121527 000053 CMPB (R5),#'+ ; LOOK FOR LEADING "+"
81 000050 001404 BEQ 30$ ; YES
82 000052 121527 000055 CMPB (R5),#'- ; LOOK FOR LEADING "-"
83 000056 001003 BNE 40$ ; NO
84 000060 005216 INC (SP) ; YES - SET NEGATIVE
85 000062 005205 30$: INC R5 ; EITHER - DISPOSE OF CHARACTER
86 000064 005304 DEC R4
OD2CT - CONVERT FROM ASCII TO T MACRO M1108 05-DEC-77 23:48 PAGE 2-1
87
88 000066 005023 40$: CLR (R3)+ ; ZERO HIGH ORDER 16 BITS
89 000070 005013 CLR (R3) ; ZERO LOW ORDER 16 BITS
90
91 000072 112502 50$: MOVB (R5)+,R2 ; GET NEXT CHARACTER
92 000074 162702 000060 SUB #'0,R2 ; CONVERT DIGIT TO VALUE
93 000100 103440 BLO 90$ ; NOT A LEGAL DIGIT CHARACTER
94
95 000102 020201 CMP R2,R1 ; LAST CHANCE TO BE IN RANGE
96 000104 103036 BHIS 90$ ; DEFINITELY NOT LEGAL
97 000106 006313 ASL (R3) ; MULTIPLY CURRENT BINARY NUMBER BY 2
98 000110 006143 ROL -(R3) ; USE FULL 32 BIT ACCURACY
99 000112 012346 MOV (R3)+,-(SP) ; SAVE HIGH ORDER BITS
100 000114 011346 MOV (R3),-(SP) ; SAVE LOW ORDER BITS
101 000116 006313 ASL (R3) ; MULTIPLY AGAIN BY 2
102 000120 006143 ROL -(R3) ; KEEP THOSE BITS MOVING
103 000122 006363 000002 ASL 2(R3) ; MAKE TOTAL MULTIPLICATION BY 8
104 000126 006123 ROL (R3)+ ; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*8
105
106 000130 020127 000012 CMP R1,#10. ; CHECK WHAT RADIX WE'RE IN
107 000134 001402 BEQ 60$ ; EQUAL IF DECIMAL
108 000136 022626 CMP (SP)+,(SP)+ ; OCTAL - THROW AWAY (OLD NUMBER)*2
109 000140 000403 BR 70$
110
111 000142 062613 60$: ADD (SP)+,(R3) ; ADD BACK (OLD NUMBER)*2
112 000144 005543 ADC -(R3) ; ADD ANY OVERFLOW TO HIGH ORDER
113 000146 062623 ADD (SP)+,(R3)+ ; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*10
114
115 000150 060213 70$: ADD R2,(R3) ; ADD THIS DIGIT TO MAKE NEW TOTAL
116 000152 005563 177776 ADC -2(R3) ; MAKE SURE OVERFLOW IS CONSIDERED
117 000156 005304 DEC R4 ; COUNT CHARACTERS
118 000160 001344 BNE 50$ ; GO GET NEXT DIGIT
119
120 000162 005726 TST (SP)+ ; CHECK NEGATIVE FLAG
121 000164 001405 BEQ 80$ ; POSITIVE
122 000166 005443 NEG -(R3) ; COMPLEMENT HIGH ORDER
123 000170 005463 000002 NEG 2(R3) ; COMPLEMENT LOW ORDER
124 000174 005613 SBC (R3) ; AND PROPAGATE THE CARRY
125 000176 000257 CCC ; SET SUCCESS
126 000200 80$: RETURN
127
128 ; TO HERE ON AN ILLEGAL CHARACTER
129
130 000202 005726 90$: TST (SP)+ ; CLEAN THE STACK
131 000204 000261 SEC ; SET THE CARRY
132 000206 RETURN
133
134 .DSABL LSB
135
136 000001 .END
OD2CT - CONVERT FROM ASCII TO T MACRO M1108 05-DEC-77 23:48 PAGE 2-2
SYMBOL TABLE
.DD2CT 000000RG .OD2CT 000012RG .SAVR1= ****** GX
. ABS. 000000 000
000210 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 171 WORDS ( 1 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:05
[61,10]OD2CT,[61,20]OD2CT/-SP=[61,30]OD2CT
OPNFL MACRO M1108 05-DEC-77 23:49 PAGE 2
1 .TITLE OPNFL
2 .IDENT /04/
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 04
21 ;
22 ; D.N. CUTLER 4-JAN-72
23 ;
24 ; ROUTINE TO OPEN ALL FILES
25
26 ;
27 ; MACRO LIBRARY CALLS
28 ;
29
30 .MCALL OPEN$R,OPEN$W,PUT$
31
32 ;+
33 ; **$OPNFL-OPEN ALL FILES
34 ;
35 ; THIS ROUTINE IS CALLED TO OPEN ALL FILES THAT WERE SPECIFIED IN THE COM-
36 ; MAND INPUT STRING.
37 ;
38 ; INPUTS:
39 ;
40 ; R3=ADDRESS OF SWITCH OPTION WORD.
41 ;
42 ; OUTPUTS:
43 ;
44 ; NONE.
45 ;-
46
47 000000 032713 000000G $OPNFL::BIT #CR$FI,(R3) ;CORRECTION INPUT FILE SPECIFIED?
48 000004 001412 BEQ 10$ ;IF EQ NO
49 000006 016700 000000G MOV $CFIPT,R0 ;GET CORRECTION FILE RECORD BLOCK
50 000012 OPEN$R R0 ;OPEN CORRECTION INPUT FILE
51 000024 012701 MOV (PC)+,R1 ;ASSUME OPEN FAILURE
52 000026 000G 000G .BYTE E$R0,S$V2 ;FATAL-NO RETURN
53 000030 103453 BCS 30$ ;IF CS YES-FATAL ERROR
54 000032 032713 000000G 10$: BIT #LL$ST,(R3) ;LINE LISTING FILE SPECIFIED?
55 000036 001433 BEQ 20$ ;IF EQ NO
56 000040 016700 000000G MOV $LSTPT,R0 ;GET LINE LISTING FILE RECORD BLOCK
57 000044 OPEN$W R0 ;OPEN LINE LISTING FILE
OPNFL MACRO M1108 05-DEC-77 23:49 PAGE 2-1
58 000056 012701 MOV (PC)+,R1 ;ASSUME OPEN FAILURE
59 000060 000G 000G .BYTE E$R1,S$V2 ;FATAL-NO RETURN
60 000062 103436 BCS 30$ ;IF CS YES-FATAL ERROR
61 000064 PUT$ R0,#$FORM,#1 ;OUTPUT INITIAL FORM FEED
62 000104 103010 BCC 20$ ;IF CC OKAY
63 000106 042713 000000G BIC #LL$ST,(R3) ;CLEAR LINE LISTING BIT
64 000112 016002 000000G MOV R$NAME(R0),R2 ;GET ADDRESS OF NAME STRING
65 000116 012701 MOV (PC)+,R1 ;LINE LISTING I/O ERROR
66 000120 000G 000G .BYTE E$R10,S$V0 ;DIAGNOSTIC
67 000122 CALL $ERMSG ;OUTPUT ERROR MESSAGE
68 000126 032713 000000G 20$: BIT #SR$CO,(R3) ;SOURCE OUTPUT FILE SPECIFIED?
69 000132 001416 BEQ 40$ ;IF EQ NO
70 000134 016700 000000G MOV $SRCPT,R0 ;GET SOURCE OUTPUT FILE RECORD BLOCK
71 000140 OPEN$W R0 ;OPEN SOURCE OUTPUT FILE
72 000152 103006 BCC 40$ ;IF CC OKAY
73 000154 012701 MOV (PC)+,R1 ;OPEN FAILURE
74 000156 000G 000G .BYTE E$R2,S$V2 ;FATAL-NO RETURN
75 000160 016002 000000G 30$: MOV R$NAME(R0),R2 ;GET ADDRESS OF NAME STRING
76 000164 CALL $ERMSG ;OUTPUT ERROR MESSAGE
77 000170 40$: RETURN ;
78
79 000001 .END
OPNFL MACRO M1108 05-DEC-77 23:49 PAGE 2-2
SYMBOL TABLE
CR$FI = ****** GX FO.RD = ****** GX PAR$$$= 000000 $CFIPT= ****** GX $SRCPT= ****** GX
E$R0 = ****** GX FO.WRT= ****** GX R$NAME= ****** GX $ERMSG= ****** GX $$ = 000001
E$R1 = ****** GX F.FACC= ****** GX SR$CO = ****** GX $FORM = ****** GX .OPEN = ****** G
E$R10 = ****** GX F.NRBD= ****** GX S$V0 = ****** GX $LSTPT= ****** GX .PUT = ****** G
E$R2 = ****** GX LL$ST = ****** GX S$V2 = ****** GX $OPNFL 000000RG
. ABS. 000000 000
000172 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 1360 WORDS ( 6 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:12
[61,10]OPNFL,[61,20]OPNFL/-SP=[61,30]MACFL,OPNFL
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4
1 .TITLE POSIT
2 .IDENT /06/
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 06
21 ;
22 ; D.N. CUTLER 4-JAN-72
23 ;
24 ; MODIFICATIONS:
25 ;
26 ; C. MONIA 11-SEP-75
27 ;
28 ; CM001 -- REWRITE ENTIRE MODULE TO ADD IMPROVED LINE
29 ; LOCATING FACILITY AND USER-SPECIFIED AUDIT
30 ; TRAIL.
31 ;
32 ;
33 ; POSITION/DELETE LINES IN CORRECTION INPUT FILE
34 ;
35 ; MACRO LIBRARY CALLS
36 ;
37
38 .MCALL CALLR
39
40 ;
41 ; LOCAL DATA
42 ;
43 ;
44 ; COMMAND LINE DESCRIPTOR
45 ;
46
47 000000 CMLD: .BLKW 1 ; LENGTH OF LINE
48 000002 000004' .WORD CMLN ; ADDRESS OF LINE
49
50 ;
51 ; COMMAND LINE BUFFER
52 ;
53
54 000004 CMLN: .BLKW 45. ;
55
56 ;
57 ; CURRENT SEARCH STRING DESCRIPTOR BEING BUILT
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-1
58 ;
59
60 000136 CURST: .BLKW 1 ;
61
62 ;
63 ; END OF LINE NUMBER RANGE
64 ;
65
66 000140 ENDLN: .BLKW 1 ;
67
68 ;
69 ; COMMAND LINE ERROR FLAG
70 ;
71
72 000142 ERROR: .BLKW 1 ;
73
74 ;
75 ; ADDRESS OF ROUTINE TO COPY/DELETE NEXT LINE
76 ;
77
78 000144 NXTLN: .BLKW 1 ;
79
80 ;
81 ; PERIOD COUNTER
82 ;
83
84 000146 PERCT: .BLKW 1 ;
85
86 ;
87 ; SEARCH STRING DESCRIPTOR 1
88 ;
89
90 000150 SRC1: .BLKW 2 ;
91
92 ;
93 ; SEARCH STRING DESCRIPTOR 2
94 ;
95
96 000154 SRC2: .BLKW 2 ;
97
98 ;
99 ; STATE TABLE TO PARSE THE FOLLOWING SYNTAX
100 ;
101 ; -[LOCATE][,LOCATE][,AUDIT]
102 ;
103 ; WHERE:
104 ;
105 ; LOCATE:=DNUMBER/STRING/EXP
106 ; AUDIT:=STRING
107 ;
108 ; DNUMBER:=0/1/2/3/4...9
109 ; STRING:='/'!CHARACTER!'/'
110 ; EXP:=.!+!DNUMBER
111 ;
112 ; INITIALIZE STATE TABLE PARAMETERS
113 ;
114
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-2
115 000160 ISTAT$ PSTAT,PKEY
116
117 ;
118 ; PARSE FIELD 0 LOCATION DESCRIPTOR
119 ;
120
121 000160 STATE$ FLD0 ;
122 000160 TRAN$ <';>,$EXIT ; EXIT ON END OF STRING
123 000160 TRAN$ <',>,ENDFL1 ; TEST FOR FIELD 1 END CONDITIONS
124 000160 TRAN$ $EOS,$EXIT ; EXIT ON NULL LINE
125 000160 TRAN$ $LAMDA,,SFLD0 ; TRANSIT TO NEXT STATE
126 000160 STATE$ ;
127 000160 TRAN$ !FIELD ; PARSE ONE FIELD
128 000160 STATE$ ;
129 000160 TRAN$ <',>,FLD1 ; SET FIELD 1 CONDITIONS
130 000160 TRAN$ <';>,$EXIT,EXFL0 ; FLUSH CURRENT LINE
131 000160 TRAN$ $EOS,$EXIT,EXFL0 ; FLUSH CURRENT LINE
132
133 ;
134 ; PARSE FIELD 1 LOCATION DESCRIPTOR
135 ;
136
137 000160 STATE$ FLD1 ;
138 000160 TRAN$ <',>,AUDIT,EXFL0 ; FLUSH CURRENT LINE IF NOP
139 000160 TRAN$ $LAMDA,,SFLD1 ; SET FIELD 1 CONDITIONS
140 000160 STATE$ ;
141 000160 TRAN$ !FIELD ; PROCESS FIELD 1
142 000160 STATE$ ENDFL1 ;
143 000160 TRAN$ <',>,AUDIT ; TEST FOR AUDIT
144 000160 TRAN$ $LAMDA,EXIT ; ELSE EXIT
145
146 ;
147 ; PARSE AUDIT STRING FIELD
148 ;
149
150 000160 STATE$ AUDIT ;
151 000160 TRAN$ '/,CPAUD,INAUD ; COPY AUDIT STRING
152 000160 TRAN$ $LAMDA,EXIT ; TEST FOR EXIT CONDITIONS
153 000160 STATE$ CPAUD ;
154 000160 TRAN$ '/,AUOUT,ENBS ; EXIT ON STRING TERMINATOR
155 000160 TRAN$ $EOS,$EXIT,ENBS ; EXIT ON END-OF-STRING
156 000160 TRAN$ $ANY,CPAUD,STAUD ; STORE AUDIT STRING
157 000160 STATE$ AUOUT ;
158 000160 TRAN$ $LAMDA,EXIT ; TEST FOR PROPER EXIT CONDITIONS
159
160 ;
161 ; CONDITIONAL EXIT FROM PARSER
162 ;
163
164 000160 STATE$ EXIT ;
165 000160 TRAN$ <';>,$EXIT ; EXIT ON SEMICOLON TERMINATOR
166 000160 TRAN$ $EOS,$EXIT ; EXIT ON END-OF-STRING
167
168 ;
169 ; PARSE A SINGLE LOCATION FIELD
170 ;
171
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-3
172 000160 STATE$ FIELD ;
173 000160 TRAN$ '/,STRING,SETCH ; SETUP TO COLLECT A STRING
174 000160 TRAN$ <'.>,EXPR,STCUR ; MARK CURRENT LOCATION
175 000160 TRAN$ $DNUMB,$EXIT,NUMB ; PROCESS LINE NUMBER
176 000160 TRAN$ $LAMDA,$EXIT ; EXIT IF ANYTHING ELSE
177
178 ;
179 ; COPY AND LOCATE STRING
180 ;
181
182 000160 STATE$ STRING ;
183 000160 TRAN$ '/,STRG2,FNDST ; FIND LINE CONTAINING STRING
184 000160 TRAN$ <'.>,STRING,ELIPS ; CHECK FOR ELLIPSES
185 000160 TRAN$ $EOS,$EXIT,FNDST ; FIND LINE CONTAINING STRING, EXIT
186 000160 TRAN$ $ANY,STRING,MOVCH ; COPY CHARACTER
187 000160 STATE$ STRG2 ; COMPUTE LINE OFFSET AND LOCATE
188 000160 TRAN$ '+,EXP1,EXFL0 ; COMPUTE AN OFFSET, FLUSH CURRENT LINE
189 000160 TRAN$ $LAMDA,$EXIT ; EXIT ON ANYTHING ELSE
190
191 ;
192 ; PROCESS EXPRESSION
193 ;
194
195 000160 STATE$ EXPR ;
196 000160 TRAN$ '+,EXP1 ; TRANSIT TO NEXT STATE ON +
197 000160 TRAN$ $EOS,$EXIT,OPER ; PERFORM OPERATION IF EOS
198 000160 TRAN$ $LAMDA,$EXIT,OPER ; PERFORM OPERATION IF ANYTHING ELSE
199 000160 STATE$ EXP1 ;
200 000160 TRAN$ $DNUMBR,$EXIT,OPER ; OPERATE ON NUMBER
201
202 000160 STATE$
203
204 ;+
205 ; **-$POSIT-POSITION/DELETE LINE IN CORRECTION FILE
206 ;
207 ; THIS ROUTINE IS CALLED TO POSITION OR DELETE LINES FROM THE
208 ; CORRECTION INPUT FILE AND CONDITIONALLY ALTER THE AUDIT STRING
209 ; THAT IS OUTPUT WITH EACH NEW LINE.
210 ;
211 ; POSITIONING OR DELETION IS PERFORMED IN ACCORDANCE WITH THE
212 ; CONTENTS OF EACH LOCATION FIELD. THIS FIELD IDENTIFIES THE
213 ; LINE TO BE LOCATED OR A RANGE OF LINES TO BE DELETED AS FOLLOWS:
214 ;
215 ; A) A NUMBER WITHIN THE FIELD SPECIFIES A LINE NUMBER;
216 ;
217 ; B) AN EXPRESSION OF THE FORM '.'[+NNN] SPECIFIES AN OFFSET
218 ; FROM THE CURRENT LINE;
219 ;
220 ; C) A STRING OF THE FORM '/ABCD.../' SPECIFIES A
221 ; CHARACTER STRING THAT IS USED TO LOCATE THE NEXT LINE
222 ; TO BE OPERATED UPON.
223 ;
224 ; INPUTS:
225 ;
226 ; $LNBUF CONTAINS THE CURRENT COMMAND LINE, $LNDES CONTAINS
227 ; THE BYTE COUNT OF THE LINE.
228 ;
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-4
229
230 000160 $POSIT:: ;
231 000160 SAVRG ; SAVE THE NON-VOLATILE REGISTERS
232 000164 012700 000004' MOV #CMLN,R0 ; GET ADDRESS OF COMMAND LINE BUFFER
233 000170 010004 MOV R0,R4 ; SAVE COMMAND LINE ADDRESS
234 000172 005204 INC R4 ; STEP PAST '-'
235 000174 012701 000000G MOV #$LNBUF,R1 ; GET ADDRESS OF LINE BUFFER
236 000200 016703 000000G MOV $PDLGH,R3 ; GET LENGTH OF PADDED LINE
237 000204 105063 000000G CLRB $LNBUF(R3) ; MAKE SURE LINE TERMINATES HERE
238 000210 005003 CLR R3 ; INITIALIZE COUNT
239 000212 10$: ;
240 000212 005203 INC R3 ; INCREMENT CHARACTER COUNT
241 000214 112120 MOVB (R1)+,(R0)+ ; COPY COMMAND LINE
242 000216 001375 BNE 10$ ; IF NE CONTINUE
243 000220 005303 DEC R3 ; CORRECT FOR NULL
244 000222 012702 000000' MOV #PKEY,R2 ; GET ADDRESS OF KEYWORD TABLE
245 000226 010367 177546 MOV R3,CMLD ; SET BYTE COUNT
246 000232 005303 DEC R3 ; ACCOUNT FOR DELETED CHARACTER
247 000234 012705 000000' MOV #PSTAT,R5 ; GET STATETABLE ADDRESS
248 000240 005001 CLR R1 ; SURPRESS BLANKS
249 000242 CALL .TPARS ; PARSE THE LINE
250 000246 103006 BCC 20$ ; IF C/C OK
251 000250 012702 000000' MOV #CMLD,R2 ; GET ADDRESS OF COMMAND LINE DESCRIPTOR
252 000254 012701 000000C MOV #<S$V1*400!E$R14>,R1 ; SET ERROR, SEVERITY
253 000260 CALL $ERMSG ; REPORT SYNTAX ERROR
254 000264 20$: ;
255 000264 RETURN ;
256
257 ;
258 ; ACTION SUBROUTINES
259 ;
260 ; COPY A LINE OF TEXT TO SOURCE AND LISTING FILES
261 ;
262
263 .ENABL LSB
264
265 000266 COPY: ;
266 000266 CALL $GTCFL ; READ ONE LINE OF INPUT
267 000272 103405 BCS 10$ ; IF C/S EOF OR ERROR
268 000274 CALL @(SP)+ ; TEST IF LOCATION CRITERIA SATISFIED
269 000276 103017 BCC 20$ ; IF C/C YES, TERMINATE COPY
270 000300 CALL EXFL0 ; WRITE CURRENT LINE TO OUTPUT FILES
271 000304 000770 BR COPY ; READ NEXT CORRECTION INPUT LINE
272 000306 10$: ; REPORT PREMATURE EOF
273 000306 016700 000000G MOV $CFIPT,R0 ; GET CORRECTION FILE BLOCK
274 000312 016002 000000G MOV R$NAME(R0),R2 ; POINT TO NAME STRING
275 000316 012701 000000C MOV #<S$V0*400!E$R3>,R1 ; GET ERROR/SEVERITY
276 000322 CALL $ERMSG ; REPORT ERROR
277 000326 042767 000000G 000000G BIC #CR$FI,$SWTCH ; CLEAR CORRECTION INPUT FILE SWITCH
278 000334 000261 SEC ; SET ERROR CONDITION
279 000336 20$: ;
280 000336 RETURN ;
281
282 ;
283 ; DELETE A LINE OF CORRECTION FILE TEXT
284 ;
285
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-5
286 000340 DELET: ;
287 000340 005267 000000G INC $LNDEL ; INCREMENT COUNT OF LINES DELETED
288 000344 103005 BCC 30$ ; IF C/C REACHED END OF DELETE RANGE
289 000346 CALL $GTCFL ; COPY OVER CURRENT LINE
290 000352 103755 BCS 10$ ; IF C/S ERROR
291 000354 CALL @(SP)+ ; CALL THE CALLER
292 000356 000770 BR DELET ; GO AGAIN
293 000360 30$: ;
294 000360 RETURN ;
295
296 .DSABL LSB
297
298 ;
299 ; RECOGNIZE ELIPSES (...)
300 ;
301
302 000362 ELIPS: ;
303 000362 012701 000136' MOV #CURST,R1 ; GET ADDRESS OF CURRENT SEARCH DESCRIPTOR
304 000366 022711 000154' CMP #SRC2,(R1) ; SEEN ONE SET OF ELIPSES?
305 000372 001540 BEQ MOVC1 ; IF EQ YES
306 000374 005267 177546 INC PERCT ; INCREMENT PERIOD COUNTER
307 000400 026727 177542 000003 CMP PERCT,#3 ; SEEN THREE IN A ROW?
308 000406 002532 BLT MOVC1 ; IF LT NO
309 000410 RETURN ;
310
311 ;
312 ; ENABLE BLANK SURPRESSION
313 ;
314
315 000412 ENBS: ;
316 000412 005067 000000G CLR .PFLAG ; ENABLE BLANK SURPRESSION
317 000416 RETURN ;
318
319
320 ;
321 ; FIND A LINE WITH MATCHING STRING
322 ;
323
324 000420 FNDST: ;
325 000420 005067 000000G CLR .PFLAG ; ALLOW BLANK SURPRESSION
326 000424 005767 177512 TST ERROR ; COMMAND LINE ERROR DETECTED?
327 000430 001051 BNE 70$ ; IF NE YES
328 000432 SAVRG ; SAVE VOLATILE REGISTERS
329 000436 016746 177502 MOV NXTLN,-(SP) ; SET COPY/DELET SUBROUTINE ADDRESS
330 000442 000261 SEC ; FORCE READ OF NEXT LINE
331 000444 10$: ;
332 000444 CALL @(SP)+ ; CALL COPY/DELET ROUTINE
333 000446 005567 177470 ADC ERROR ; POSSIBLY SET ERROR CONDITION
334 000452 001040 BNE 70$ ; IF NE ERROR
335 000454 012701 000150' MOV #SRC1,R1 ; GET ADDRESS OF SEARCH FIELD 1
336 000460 012704 000000G MOV #$LNBUF,R4 ; GET LINE BUFFER ADDRESS
337 000464 CALL 30$ ; SEARCH FOR STRING
338 000470 005226 INC (SP)+ ; REMOVE RETURN ADDRESS
339 000472 103001 BCC 20$ ; IF C/C SEARCH STRING 1 MATCHED
340 000474 000763 BR 10$ ; GET NEXT LINE
341 000476 20$: ;
342 000476 012701 000154' MOV #SRC2,R1 ; GET ADDRESS OF STRING 2 DESCRIPTOR
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-6
343 000502 30$: ;
344 000502 010405 MOV R4,R5 ; COPY CURRENT LINE BUFFER POINTER
345 000504 40$: ;
346 000504 011102 MOV (R1),R2 ; GET DESCRIPTOR BYTE COUNT
347 000506 016103 000002 MOV 2(R1),R3 ; GET STRING ADDRESS
348 000512 50$: ;
349 000512 005302 DEC R2 ; DECREMENT STRING COUNT
350 000514 000241 CLC ; ASSUME MATCH
351 000516 002410 BLT 60$ ; IF LT HAVE MATCH
352 000520 105714 TSTB (R4) ; END OF STRING?
353 000522 000261 SEC ; ASSUME YES
354 000524 001747 BEQ 10$ ; CALL CALLER
355 000526 122324 CMPB (R3)+,(R4)+ ; TEST STRING
356 000530 001770 BEQ 50$ ; IF EQ POSSIBLE MATCH
357 000532 005205 INC R5 ; INCREMENT POINTER
358 000534 010504 MOV R5,R4 ; RESET STRING POINTER
359 000536 000762 BR 40$ ; GO AGAIN
360 000540 60$: ;
361 000540 016767 000000G 177372 MOV $CFNMB,ENDLN ; SET END LINE NUMBER
362 000546 005067 000000G CLR .PNUMB ; CLEAR LINE NUMBER
363 000552 CALL @(SP)+ ; CALL THE CALLER
364 000554 70$: ;
365 000554 RETURN ;
366
367 ;
368 ; FLUSH CORRECTION FILE INPUT BUFFER AT END OF FIELD 0
369 ;
370
371 000556 EXFL0: ;
372 000556 032767 000000G 000000G BIT #AP$ND,$SWTCH ; COMRESS LINE?
373 000564 001002 BNE 10$ ; IF NE NO
374 000566 CALL $CMPRS ; COMPRESS CURRENT LINE
375 000572 10$: ;
376 000572 005067 000000G CLR $LNDEL ; CLEAR COUNT OF SUCCESIVE DELETIONS
377 000576 CALLR $PUTLN ; WRITE LINE TO OUTPUT FILES
378
379 ;
380 ; INITIALIZE FOR COLLECTION OF AUDIT STRING
381 ;
382
383 000602 INAUD: ;
384 000602 005267 000000G INC .PFLAG ; RESET BLANK SUPRESSION
385 000606 016701 000000G MOV $AULGH,R1 ; GET LENGTH OF FIELD
386 000612 012702 000150' MOV #SRC1,R2 ; GET ADDRESS OF STRING DESCRIPTOR
387 000616 010122 MOV R1,(R2)+ ; SAVE MAX STRING SIZE
388 000620 012712 000000G MOV #$NEW,(R2) ; SAVE ADDRESS OF AUDIT BUFFER
389 000624 011202 MOV (R2),R2 ; SET BUFFER ADDRESS
390 000626 10$: ;
391 000626 105022 CLRB (R2)+ ; CLEAR AUDIT STRING
392 000630 005301 DEC R1 ; DECREMENT MAX AUDIT TRAIL SIZE
393 000632 002375 BGE 10$ ; IF GE GO AGAIN
394 000634 RETURN ;
395
396 ;
397 ; BUILD CHARACTER STRING FOR SEARCH
398 ;
399
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-7
400 000636 MOVCH: ;
401 000636 012701 000136' MOV #CURST,R1 ; GET POINTER TO STRING DESCRIPTOR
402 000642 012700 000146' MOV #PERCT,R0 ; GET ADDRESS OF PERIOD COUNTER
403 000646 021027 000003 CMP (R0),#3 ; SEEN ELLIPSES?
404 000652 103410 BLO MOVC1 ; IF LO NO
405 000654 162731 000002 SUB #2,@(R1)+ ; BACK-UP SEARCH STRING
406 000660 012741 000154' MOV #SRC2,-(R1) ; SET ADDRESS OF NEW STRING
407 000664 016767 000000G 177264 MOV .PSTPT,SRC2+2 ; SET ADDRESS OF START OF STRING
408 000672 005010 CLR (R0) ; RESET PERIOD COUNT
409 000674 MOVC1: ;
410 000674 005231 INC @(R1)+ ; INCREMENT STRING COUNT
411 000676 RETURN ;
412
413 ;
414 ; FIND SPECIFIED LINE NUMBER
415 ;
416
417 000700 NUMB: ;
418 000700 005767 177236 TST ERROR ; COMMAND LINE ERROR DETECTED?
419 000704 001033 BNE 40$ ; IF NE YES
420 000706 016746 177232 MOV NXTLN,-(SP) ; PUSH ADDRESS OF LINE PROCESSOR
421 000712 026767 000000G 000000G CMP $CFNMB,.PNUMB ; LEGAL LINE NUMBER?
422 000720 101015 BHI 30$ ; IF HI NO
423 000722 001004 BNE 10$ ; IF NE OK
424 000724 021627 000340' CMP (SP),#DELET ; IN FIELD 1?
425 000730 001407 BEQ 20$ ; IF EQ YES
426 000732 000410 BR 30$ ; ELSE ERROR
427 000734 10$: ;
428 000734 CALL @(SP)+ ; CALL LINE PROCESSOR
429 000736 103416 BCS 40$ ; IF C/S ERROR READING CORRECTION INPUT FILE
430 000740 026767 000000G 000000G CMP $CFNMB,.PNUMB ; HAVE SPECIFIED LINE?
431 000746 103772 BLO 10$ ; IF LO NO
432 000750 20$: ;
433 000750 CALL @(SP)+ ; SET DELETE COUNT
434 000752 000410 BR 40$ ; EXIT
435 000754 30$: ;
436 000754 005726 TST (SP)+ ; CLEAN STACK
437 000756 012702 000000' MOV #CMLD,R2 ; GET LINE DESCRIPTOR ADDRESS
438 000762 012701 000000C MOV #<S$V0*400!E$R20>,R1 ; GET ERROR/SEVERITY
439 000766 CALL $ERMSG ; OUTPUT ERROR MESSAGE
440 000772 000261 SEC ; SET LINE ERROR CONDITION
441 000774 40$: ;
442 000774 005567 177142 ADC ERROR ; UPDATE ERROR STATUS
443 001000 RETURN ;
444
445 ;
446 ; COMPUTE NEXT LINE NUMBER AND PROCESS IT
447 ;
448
449 001002 OPER: ;
450 001002 066767 177132 000000G ADD ENDLN,.PNUMB ; COMPUTE LINE NUMBER TO BE FOUND
451 001010 000733 BR NUMB ; SEARCH FOR SPECIFIED LINE
452
453 ;
454 ; SETUP CHARACTER STRING DESCRIPTORS FOR SEARCH
455 ;
456
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-8
457 001012 SETCH: ;
458 001012 005267 000000G INC .PFLAG ; DISABLE BLANK SUPRESSION
459 001016 005067 177124 CLR PERCT ; CLEAR PERIOD COUNT
460 001022 012701 000150' MOV #SRC1,R1 ; GET STRING DESCRIPTOR ADDRESS
461 001026 010167 177104 MOV R1,CURST ; SET ADDRESS OF CURRENT STRING
462 001032 005021 CLR (R1)+ ; ZERO COUNT
463 001034 016711 000000G MOV .PSTPT,(R1) ; SET ADDRESS OF FIRST CHARACTER
464 001040 005211 INC (R1) ; ...
465 001042 012102 MOV (R1)+,R2 ; GET ADDRESS OF FIRST CHARACTER
466 001044 005021 CLR (R1)+ ; CLEAR STRING 2 COUNT
467 001046 010211 MOV R2,(R1) ; SAVE STRING ADDRESS
468 001050 RETURN ;
469
470 ;
471 ; SETUP FOR PROCESSING FIELD 0 INPUT
472 ;
473
474 001052 SFLD0: ;
475 001052 005067 177064 CLR ERROR ; RESET LINE NUMBER ERROR FLAG
476 001056 012767 000266' 177060 MOV #COPY,NXTLN ; SET FOR COPY LINE OPERATION
477 001064 RETURN ;
478
479 ;
480 ; SETUP FOR PROCESSING FIELD 1 INPUT
481 ;
482
483 001066 SFLD1: ;
484 001066 012767 000340' 177050 MOV #DELET,NXTLN ; SET FOR LINE DELETION OPERATION
485 001074 RETURN ;
486
487 ;
488 ; STORE AN AUDIT CHARACTER
489 ;
490
491 001076 STAUD: ;
492 001076 012701 000150' MOV #SRC1,R1 ; GET ADDRESS OF AUDIT STRING DESCRIPTOR
493 001102 005711 TST (R1) ; ROOM FOR MORE?
494 001104 001404 BEQ 10$ ; IF EQ NO
495 001106 005321 DEC (R1)+ ; DECREMENT AUDIT COUNT
496 001110 116731 000000G MOVB .PCHAR,@(R1)+ ; STORE AUDIT CHARACTER
497 001114 005241 INC -(R1) ; POINT TO NEXT OUTPUT BYTE
498 001116 10$: ;
499 001116 RETURN ;
500
501 ;
502 ; POSITION CORRECTION INPUT FILE TO NEXT LINE
503 ;
504
505 001120 STCUR: ;
506 001120 005067 000000G CLR .PNUMB ; CLEAR LINE NUMBER INCREMENT
507 001124 016767 000000G 177006 MOV $CFNMB,ENDLN ; SET END LINE NUMBER
508 001132 022767 000340' 177004 CMP #DELET,NXTLN ; IN DELETE MODE?
509 001140 001402 BEQ 10$ ; IF EQ YES
510 001142 005267 176772 INC ENDLN ; FORCE READ OF NEXT LINE
511 001146 10$: ;
512 001146 RETURN ;
513
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-9
514 000001 .END
POSIT MACRO M1108 05-DEC-77 23:49 PAGE 4-10
SYMBOL TABLE
AP$ND = ****** GX EXPR 000232R 002 PSTAT 000000RG 002 $BLANK= 000306 $POSIT 000160RG
AUDIT 000072R 002 EXP1 000252R 002 R$NAME= ****** GX $CFIPT= ****** GX $PUTLN= ****** GX
AUOUT 000126R 002 E$R14 = ****** GX SETCH 001012R $CFNMB= ****** GX $RAD50= 000316
CMLD 000000R E$R20 = ****** GX SFLD0 001052R $CMPRS= ****** GX $SAVRG= ****** GX
CMLN 000004R E$R3 = ****** GX SFLD1 001066R $DIGIT= 000324 $STRNG= 000304
COPY 000266R FIELD 000142R 002 SRC1 000150R $DNUMB= 000314 $SUBXP= 000310
CPAUD 000104R 002 FLD0 000000R 002 SRC2 000154R $EOS = 000312 $SWTCH= ****** GX
CR$FI = ****** GX FLD1 000044R 002 STAUD 001076R $ERMSG= ****** GX $$ = 000001
CURST 000136R FNDST 000420R STCUR 001120R $EXIT = 000000 $$$FLG= 177777
DELET 000340R INAUD 000602R STRG2 000220R 002 $GTCFL= ****** GX $$$KEY= 177777
ELIPS 000362R MOVCH 000636R STRING 000170R 002 $LAMDA= 000300 $$$STA= 000000
ENBS 000412R MOVC1 000674R S$V0 = ****** GX $LNBUF= ****** GX .PCHAR= ****** GX
ENDFL1 000062R 002 NUMB 000700R S$V1 = ****** GX $LNDEL= ****** GX .PFLAG= ****** GX
ENDLN 000140R NXTLN 000144R $ALPHA= 000322 $NEW = ****** GX .PNUMB= ****** GX
ERROR 000142R OPER 001002R $ANY = 000320 $NUMBR= 000302 .PSTPT= ****** GX
EXFL0 000556R PERCT 000146R $AULGH= ****** GX $PDLGH= ****** GX .TPARS= ****** GX
EXIT 000132R 002 PKEY 000000RG 003
. ABS. 000000 000
001150 001
$STATE 000260 002
$KTAB 000000 003
$KSTR 000000 004
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 2223 WORDS ( 9 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:01:36
[61,10]POSIT,[61,20]POSIT/-SP=[61,30]MACFL,TPMAC,POSIT
PUTLN MACRO M1108 05-DEC-77 23:50 PAGE 2
1 .TITLE PUTLN
2 .IDENT /05/
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 05
21 ;
22 ; MODIFICATIONS:
23 ;
24 ; C. MONIA 17-JUL-76
25 ;
26 ; CM003 -- ALLOW LINES PER PAGE TO BE SPECIFIED AT LINK TIME
27 ;
28 ;
29 ; D.N. CUTLER 4-JAN-72
30 ;
31 ; PUT LINE IN SOURCE OUTPUT AND LINE LISTING FILES
32 ;
33 ; MACRO LIBRARY CALLS
34 ;
35
36 .MCALL PUT$
37
38 ;
39 ; LOCAL DATA
40 ;
41
42 000000 014 000 $FORM:: .BYTE 14,0 ;
43 000002 001750 DTAB: .WORD 10.*10.*10. ;POWERS OF TEN TABLE
44 000004 000144 .WORD 10.*10. ;
45 000006 000012 .WORD 10. ;
46 000010 000001 .WORD 1. ;
47
48 ;+
49 ; **-$PUTLN-PUT LINE IN SOURCE OUTPUT AND LINE LISTING FILES
50 ;
51 ; THIS ROUTINE OUTPUTS THE LINE IN $LNBUF TO EITHER/AND THE SOURCE
52 ; OUTPUT AND LINE LISTING FILES. IF AN ERROR IS ENCOUNTERED, THEN
53 ; THE APPROPRIATE OUTPUT FILE FLAG IS CLEARED AND FURTHER PUT LINES
54 ; TO THAT FILE ARE IGNORED. BEFORE THE LINE IS OUTPUT TO THE LINE
55 ; LISTING FILE, THE CURRENT LINE NUMBER IS CONVERTED TO ASCII AND
56 ; STORED IN $LINHD. THE LINE HEADER AND LINE ARE THEN OUTPUT.
57 ;
PUTLN MACRO M1108 05-DEC-77 23:50 PAGE 2-1
58 ; INPUTS:
59 ;
60 ; LINE IN $LNBUF.
61 ;
62 ; OUTPUTS:
63 ;
64 ; LNUMB$ IS INCREMENTED.
65 ;-
66
67 000012 $PUTLN::SAVRG ;SAVE NONVOLITILE REGISTERS
68 000016 012704 000000G MOV #$SWTCH,R4 ;GET ADDRESS OF SWITCH OPTION WORD
69 000022 005267 000000G INC $LNUMB ;INCREMENT LINE NUMBER
70 000026 122767 000014 000000G CMPB #14,$LNBUF ;FIRST CHARACTER FORM FEED?
71 000034 001003 BNE 1$ ;IF NE NO
72 000036 012767 000001 000000G MOV #1,$LNDES ;FORCE BYTE COUNT OF 1
73 000044 032714 000000G 1$: BIT #SR$CO,(R4) ;SOURCE OUTPUT FILE?
74 000050 001423 BEQ 3$ ;IF EQ NO
75 000052 016700 000000G MOV $SRCPT,R0 ;GET SOURCE OUTPUT FILE RECORD BLOCK
76 000056 PUT$ R0,#$LNBUF,$LNDES;OUTPUT SOURCE RECORD
77 000076 103010 BCC 3$ ;IF CC NO EOF OR ERROR
78 000100 042714 000000G BIC #SR$CO,(R4) ;CLEAR SOURCE OUTPUT BIT
79 000104 016002 000000G MOV R$NAME(R0),R2 ;GET ADDRESS OF NAME STRING
80 000110 012701 MOV (PC)+,R1 ;SOURCE OUTPUT I/O ERROR
81 000112 000G 000G .BYTE E$R9,S$V0 ;DIAGNOSTIC
82 000114 CALL $ERMSG ;OUTPUT ERROR MESSAGE
83 000120 032714 000000G 3$: BIT #LL$ST,(R4) ;LINE LISTING FILE?
84 000124 001536 BEQ 12$ ;IF EQ NO
85 000126 012700 000002G MOV #$LINHD+2,R0 ;GET ADDRESS OF LINE HEADER
86 000132 012710 020040 MOV #" ,(R0) ;BLANK LINE HEADER
87 000136 012740 020040 MOV #" ,-(R0) ;
88 000142 012702 000002' MOV #DTAB,R2 ;GET ADDRESS OF TENS TABLE
89 000146 016701 000000G MOV $LNUMB,R1 ;GET CURRENT LINE NUMBER
90 000152 020127 023420 CMP R1,#10000. ;LINE TOO BIG?
91 000156 002402 BLT 4$ ;IF LT NO
92 000160 162701 023420 SUB #10000.,R1 ;REDUCE LINE NUMBER BY 10000.
93 000164 020122 4$: CMP R1,(R2)+ ;COMPARE LINE NUMBER WITH TABLE
94 000166 002002 BGE 5$ ;IF GE FOUND PLACE
95 000170 105720 TSTB (R0)+ ;ADJUST R0
96 000172 000774 BR 4$ ;GO AGAIN
97 000174 005002 5$: CLR R2 ;SUPPRESS ZEROS
98 000176 CALL $CBDMG ;CONVERT TO DECIMAL
99 000202 062767 000006 000000G ADD #6,$LNDES ;ADD 6 BYTES FOR LINE HEADER
100 000210 005767 000000G TST $PLNMB ;TIME TO OUTPUT HEADING?
101 000214 001013 BNE 6$ ;IF NE NO
102 000216 016700 000000G MOV $LSTPT,R0 ;GET LINE LISTING FILE RECORD BLOCK
103 000222 PUT$ R0,#$HEADG,$HDSIZ;OUTPUT PAGE HEADING
104 000242 103455 BCS 10$ ;IF CS EOF OR ERROR
105 000244 016700 000000G 6$: MOV $LSTPT,R0 ;GET LINE LISTING FILE RECORD BLOCK
106 000250 PUT$ R0,#$LINHD,$LNDES;OUTPUT LINE WITH LINE NUMBER
107 000270 103442 BCS 10$ ;IF CS EOF OR ERROR
108 000272 122767 000014 000000G CMPB #14,$LNBUF ;LEADING CHARACTER A FORM FEED?
109 000300 001446 BEQ 11$ ;IF EQ YES
110 000302 012703 000001 MOV #1,R3 ;ASSUME SINGLE SPACING
111 000306 032714 000000G BIT #DB$LL,(R4) ;DOUBLE SPACING?
112 000312 001410 BEQ 8$ ;IF EQ NO
113 000314 016700 000000G MOV $LSTPT,R0 ;GET LINE LISTING FILE RECORD BLOCK
114 000320 PUT$ R0,,#0 ;OUTPUT NULL LINE
PUTLN MACRO M1108 05-DEC-77 23:50 PAGE 2-2
115 000330 103422 BCS 10$ ;IF CS EOF OR ERROR
116 000332 005203 INC R3 ;SET FOR DOUBLE SPACING
117 000334 060367 000000G 8$: ADD R3,$PLNMB ;UPDATE PAGE LINE NUMBER
118 000340 026727 000000G 000000G CMP $PLNMB,#P$GLGH ; ANY MORE ROOM LEFT ON PAGE? ;**NEW**
119 000346 002425 BLT 12$ ;IF LT YES ;**-1
120 000350 016700 000000G MOV $LSTPT,R0 ;GET LINE LISTING RECORD BLOCK
121 000354 PUT$ R0,#$FORM,#1 ;OUTPUT A FORM FEED
122 000374 103010 BCC 11$ ;IF CC NO EOF OR ERROR
123 000376 042714 000000G 10$: BIC #LL$ST,(R4) ;CLEAR LINE LISTING BIT
124 000402 016002 000000G MOV R$NAME(R0),R2 ;GET ADDRESS OF NAME STRING
125 000406 012701 MOV (PC)+,R1 ;LINE LISTING I/O ERROR
126 000410 000G 000G .BYTE E$R10,S$V0 ;DIAGNOSTIC
127 000412 CALL $ERMSG ;OUTPUT ERROR MESSAGE
128 000416 005067 000000G 11$: CLR $PLNMB ;CLEAR PAGE LINE NUMBER
129 000422 12$: RETURN ;
130
131 000001 .END
PUTLN MACRO M1108 05-DEC-77 23:50 PAGE 2-3
SYMBOL TABLE
DB$LL = ****** GX PAR$$$= 000000 $ERMSG= ****** GX $LNDES= ****** GX $SAVRG= ****** GX
DTAB 000002R P$GLGH= ****** GX $FORM 000000RG $LNUMB= ****** GX $SRCPT= ****** GX
E$R10 = ****** GX R$NAME= ****** GX $HDSIZ= ****** GX $LSTPT= ****** GX $SWTCH= ****** GX
E$R9 = ****** GX SR$CO = ****** GX $HEADG= ****** GX $PLNMB= ****** GX $$ = 000001
F.NRBD= ****** GX S$V0 = ****** GX $LINHD= ****** GX $PUTLN 000012RG .PUT = ****** G
LL$ST = ****** GX $CBDMG= ****** GX $LNBUF= ****** GX
. ABS. 000000 000
000424 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 898 WORDS ( 4 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:11
[61,10]PUTLN,[61,20]PUTLN/-SP=[61,30]MACFL,PUTLN
SAVR1 MACRO M1108 05-DEC-77 23:51 PAGE 1
1 .TITLE SAVR1
2 ; ALTERED 21-MAR-73 13:30
3 .IDENT /0101/
4 ; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
5 ;
6 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
7 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
8 ;
9 ; PETER H. LIPMAN 21-MARCH-73
10 ;
11 000000 .PSECT $$RESL
12 ;
13 .MCALL CALL,RETURN
14 ;+
15 ; SUBROUTINE TO SAVE REGISTERS R1-R5 AND RESTORE THEM ON RETURN
16 ; CALLING SEQUENCE:
17 ; JSR R5,SAVR1
18 ; INPUTS:
19 ; NONE
20 ; OUPUTS:
21 ; NONE
22 ; OPERATION:
23 ; THE ROUTINE IS A COROUTINE WHICH SAVES R1-R5
24 ; ON THE STACK, AND THEN CALLS THE CALLER. THE RETURN FROM THE
25 ; CALLER THEN POPS THE SAVED REGISTERS AND DOES A RETURN.
26 ;-
27
28 000000 010446 .SAVR1::MOV R4,-(SP) ;SAVE R4,R3,R2,R1
29 000002 010346 MOV R3,-(SP)
30 000004 010246 MOV R2,-(SP)
31 000006 010146 MOV R1,-(SP)
32 000010 010546 MOV R5,-(SP) ;PUT RETURN ADDRESS ON STACK
33 000012 016605 000012 MOV 10.(SP),R5 ;RETRIEVE REAL R5
34 000016 CALL @(SP)+ ;CALL THE CALLER
35 000020 012601 MOV (SP)+,R1 ;RESTORE R1,R2,R3,R4,R5
36 000022 012602 MOV (SP)+,R2
37 000024 012603 MOV (SP)+,R3
38 000026 012604 MOV (SP)+,R4
39 000030 012605 MOV (SP)+,R5
40 000032 RETURN
41 ;
42 ;
43 000001 .END
SAVR1 MACRO M1108 05-DEC-77 23:51 PAGE 1-1
SYMBOL TABLE
$$ = 000036 .SAVR1 000000RG 002
. ABS. 000000 000
000000 001
$$RESL 000034 002
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 164 WORDS ( 1 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:03
[61,10]SAVR1,[61,20]SAVR1/-SP=[61,30]SAVR1
SCSLP MACRO M1108 05-DEC-77 23:51 PAGE 2
1 .TITLE SCSLP
2 .IDENT /04/
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 04
21 ;
22 ; D.N. CUTLER 16-OCT-72
23 ;
24 ; MONITOR DEPENDENT COMMAND STRING ANALYSIS ROUTINES
25 ;
26 ; MACRO LIBRARY CALLS
27 ;
28
29 .MCALL CSI$1,CSI$2
30
31 ;+
32 ; **-$SCANI/$SCANO-SCAN FOR INPUT/OUTPUT FILE SPECIFCICATION
33 ;
34 ; THIS ROUTINE IS CALLED TO SCAN A COMMAND STRING FOR THE NEXT INPUT
35 ; OR OUTPUT FILE. $SYNTX MUST HAVE BEEN PREVIOUSLY CALLED TO SET UP
36 ; THE COMMAND BUFFER AND TO DO THE SYNTAX ANALYSIS.
37 ;
38 ; INPUTS:
39 ;
40 ; R0=ADDRESS OF RECORD BLOCK.
41 ; R1=ADDRESS OF TEMP BUFFER AREA.
42 ;
43 ; OUTPUTS:
44 ;
45 ; C=1 IF NO FILE SPECIFIED OR ILLEGAL SWITCH.
46 ; C=0 IF REQUEST IS SUCESSFUL.
47 ; IN EITHER CASE R0 IS RETURNED AS THE MORE FILES FLAG.
48 ; IF R0 EQ 0, THEN MORE FILES ARE SPECIFIED.
49 ; IF R0 EQ 1, THEN NO MORE FILES ARE SPECIFIED.
50 ;-
51
52 000000 112761 000001 000000 $SCANI::MOVB #CS.INP,C.TYPR(R1);SET FOR INPUT FILE
53 000006 000403 BR SCANO ;
54 000010 112761 000002 000000 $SCANO::MOVB #CS.OUT,C.TYPR(R1);SET FOR OUTPUT FILE
55 000016 SCANO: SAVRG ;SAVE NONVOLITILE REGISTERS
56 000022 010005 MOV R0,R5 ;SAVE RECORD BLOCK ADDRESS
57 000024 CSI$2 R1,,R$SWBK(R5) ;GET FILE SPECIFICATION
SCSLP MACRO M1108 05-DEC-77 23:51 PAGE 2-1
58 000040 010102 MOV R1,R2 ;COPY CSI BLOCK ADDRESS
59 000042 116204 000001 MOVB C.STAT(R2),R4 ;GET STATUS BYTE
60 000046 103444 BCS 10$ ;IF CS ILLEGAL SWITCH
61 000050 132704 000005 BITB #CS.NMF!CS.DVF,R4;FILE OR DEVICE SPECIFIED?
62 000054 001464 BEQ 60$ ;IF EQ NO
63 000056 132704 000010 BITB #CS.WLD,R4 ;WILD CARD SPECIFIED?
64 000062 001041 BNE 20$ ;IF NE YES
65 000064 022762 000000G 000006 CMP #F$DEVL,C.DEVD(R2);LEGAL DEVICE NAME LENGTH?
66 000072 103447 BLO 40$ ;IF LO NO
67 000074 022762 000000G 000012 CMP #F$DIRL,C.DIRD(R2);LEGAL DIRECTORY NAME LENGTH?
68 000102 103436 BLO 35$ ;IF LO NO
69 000104 022762 000000G 000016 CMP #F$FILL,C.FILD(R2);LEGAL FILENAAME LENGTH?
70 000112 103425 BLO 20$ ;IF LO NO
71 000114 016505 000000G MOV F.DSPT(R5),R5 ;GET ADDRESS OF DATA SET DESCRIPTOR
72 000120 062702 000006 ADD #C.DSDS,R2 ;POINT TO CSI DATA SET DESCRIPTOR
73 000124 012746 000003 MOV #3,-(SP) ;SET LOOP COUNT
74 000130 012203 3$: MOV (R2)+,R3 ;GET LENGTH OF LINE SEGMENT
75 000132 010325 MOV R3,(R5)+ ;STORE IN DESCRIPTOR
76 000134 012201 MOV (R2)+,R1 ;GET ADDRESS OF LINE SEGMENT
77 000136 012500 MOV (R5)+,R0 ;GET ADDRESS TO STORE LINE SEGMENT
78 000140 005303 5$: DEC R3 ;DECREMENT BYTE COUNT
79 000142 002402 BLT 7$ ;IF LT DONE
80 000144 112120 MOVB (R1)+,(R0)+ ;
81 000146 000774 BR 5$ ;
82 000150 005316 7$: DEC (SP) ;DECREMENT LOOP COUNT
83 000152 003366 BGT 3$ ;IF GT MORE TO GO
84 000154 005726 TST (SP)+ ;CLEAN STACK
85 000156 000424 BR 70$ ;
86
87 ;
88 ; ILLEGAL SWITCH SPECIFICATION
89 ;
90
91 000160 012701 10$: MOV (PC)+,R1 ;GET ERROR,SEVERITY
92 000162 000G 000G .BYTE E$R11,S$V2 ;FATAL-NO RETURN
93 000164 000402 BR 30$ ;
94
95 ;
96 ; ILLEGAL FILE SPECIFICATION
97 ;
98
99 000166 012701 20$: MOV (PC)+,R1 ;GET ERROR,SEVERITY
100 000170 000G 000G .BYTE E$R12,S$V2 ;FATAL-NO RETURN
101 000172 062702 000016 30$: ADD #C.FILD,R2 ;POINT TO FILENAME DESCRIPTOR
102 000176 000411 BR 50$ ;
103
104 ;
105 ; ILLEGAL DIRECTORY NAME
106 ;
107
108 000200 012701 35$: MOV (PC)+,R1 ;GET ERROR,SEVERITY
109 000202 000G 000G .BYTE E$R17,S$V2 ;FATAL-NO RETURN
110 000204 062702 000012 ADD #C.DIRD,R2 ;POINT TO DIRECTORY NAME
111 000210 000404 BR 50$ ;
112
113 ;
114 ; ILLEGAL DEVICE SPECIFICATION
SCSLP MACRO M1108 05-DEC-77 23:51 PAGE 2-2
115 ;
116
117 000212 012701 40$: MOV (PC)+,R1 ;GET ERROR,SEVERITY
118 000214 000G 000G .BYTE E$R13,S$V2 ;FATAL-NO RETURN
119 000216 062702 000006 ADD #C.DEVD,R2 ;POINT TO DEVICE NAME DESCRIPTOR
120 000222 50$: CALL $ERMSG ;OUTPUT ERROR MESSAGE
121 000226 000261 60$: SEC ;SET CARRY
122 000230 006046 70$: ROR -(SP) ;SAVE CARRY BIT
123 000232 005000 CLR R0 ;ASSUME MORE FILES ARE SPECIFIED
124 000234 132704 000020 BITB #CS.MOR,R4 ;MORE FILES?
125 000240 001001 BNE 80$ ;IF NE YES
126 000242 005200 INC R0 ;SET NO FILES
127 000244 006126 80$: ROL (SP)+ ;RESTORE CARRY
128 000246 RETURN ;
129
130 ;+
131 ; **-$SYNTX-COMMAND STRING SYNTAX ANALYSIS
132 ;
133 ; THIS ROUTINE IS CALLED TO ANALYZE A COMMAND STRING FOR CORRECT SYN-
134 ; TAX AND TO SET UP THE COMMAND BUFFER FOR THE ABOVE SCAN ROUTINES.
135 ;
136 ; INPUTS:
137 ;
138 ; R0=ADDRESS OF BYTE COUNT,REC ADDR DOUBLEWORD.
139 ; R1=ADDRESS OF TEMP BUFFER AREA
140 ;
141 ; OUTPUTS:
142 ;
143 ; C=1 IF SYNTAX ERROR.
144 ; C=0 IF NO SYNTAX ERROR.
145 ;-
146
147 000250 012061 000002 $SYNTX::MOV (R0)+,C.CMLD(R1);SET LENGTH OF LINE
148 000254 011061 000004 MOV (R0),C.CMLD+2(R1);SET ADDRESS OF LINE
149 000260 CSI$1 R1 ;ANALYZE SYNTAX
150 000266 103010 BCC 10$ ;IF CS RETURN
151 000270 010102 MOV R1,R2 ;COPY ADDRESS OF CSI BLOCK
152 000272 062702 000002 ADD #C.CMLD,R2 ;POINT TO LINE SEGMENT DESCRIPTOR
153 000276 012701 MOV (PC)+,R1 ;SYNTAX ERROR
154 000300 000G 000G .BYTE E$R14,S$V1 ;DIAGNOSTIC
155 000302 CALL $ERMSG ;OUTPUT ERROR MESSAGE
156 000306 000261 SEC ;SET CARRY
157 000310 10$: RETURN ;
158
159 000001 .END
SCSLP MACRO M1108 05-DEC-77 23:51 PAGE 2-3
SYMBOL TABLE
CS.DIF= 000002 C.DEVD= 000006 C.SWAD= 000022 F$DIRL= ****** GX $ERMSG= ****** GX
CS.DVF= 000004 C.DIRD= 000012 C.TYPR= 000000 F$FILL= ****** GX $SAVRG= ****** GX
CS.EQU= 000040 C.DSDS= 000006 E$R11 = ****** GX F.DSPT= ****** GX $SCANI 000000RG
CS.INP= 000001 C.FILD= 000016 E$R12 = ****** GX PAR$$$= 000001 $SCANO 000010RG
CS.MOR= 000020 C.MKW1= 000024 E$R13 = ****** GX R$SWBK= ****** GX $SYNTX 000250RG
CS.NMF= 000001 C.MKW2= 000026 E$R14 = ****** GX SCANO 000016R $$ = 000001
CS.OUT= 000002 C.SIZE= 000054 E$R17 = ****** GX S$V1 = ****** GX .CSI1 = ****** G
CS.WLD= 000010 C.STAT= 000001 F$DEVL= ****** GX S$V2 = ****** GX .CSI2 = ****** G
C.CMLD= 000002
. ABS. 000000 000
000312 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 1232 WORDS ( 5 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:09
[61,10]SCSLP,[61,20]SCSLP/-SP=[61,30]MACFL,SCSLP
SLPCRF MACRO M1108 05-DEC-77 23:51 PAGE 2
1 .TITLE SLPCRF
2 .IDENT /06/ ; CM001
3
4 ;
5 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ;
7 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
8 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
9 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
10 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
11 ;
12 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
13 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
14 ; EQUIPMENT CORPORATION.
15 ;
16 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
17 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
18 ;
19 ; VERSION 06 ; CM001
20 ;
21 ; **-SEQUENCE: CM001
22 ;
23 ; DESCRIPTION:
24 ;
25 ; ADD USER-SELECTABLE AUDIT TRAIL
26 ;
27 ; AUTHOR: C. A. MONIA
28 ;
29 ; FILES MODIFIED:
30 ;
31 ; ERSLP
32 ; GETLN
33 ; GTSLP
34 ; IOSLP
35 ; POSIT
36 ; SLPR11
37 ; SLPSB
38 ;
39 ; **-SEQUENCE: CM002
40 ;
41 ; DESCRIPTION:
42 ;
43 ; CORRECT COMMAND LINE NUMBER ERROR MESSAGE OUTPUT
44 ;
45 ; FILES MODIFIED:
46 ;
47 ; POSIT
48 ;
49 ; **-SEQUENCE: CM003
50 ;
51 ; DESCRIPTION:
52 ;
53 ; ALLOW LINES PER PAGE TO BE REDEFINED AT LINK TIME
54 ;
55 ; FILES MODIFIED:
56 ;
57 ; PUTLN
SLPCRF MACRO M1108 05-DEC-77 23:51 PAGE 2-1
58 ;
59
60 000001 .END
SLPCRF MACRO M1108 05-DEC-77 23:51 PAGE 2-2
SYMBOL TABLE
. ABS. 000000 000
000000 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 304 WORDS ( 2 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:03
[61,10]SLPCRF,[61,20]SLPCRF/-SP=[61,30]MACFL,SLPCRF
SLPR11 MACRO M1108 05-DEC-77 23:51 PAGE 2
1 .TITLE SLPR11
2 .IDENT /06/ ; CM001
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 06 ; CM001
21 ;
22 ; D.N. CUTLER 4-JAN-72
23 ;
24 ; MODIFICATIONS:
25 ;
26 ; C. MONIA 11-SEP-75
27 ;
28 ; CM001 -- ADD USER-SPECIFIED AUDIT TRAIL
29 ;
30 ; SOURCE LANGUAGE INPUT PROGRAM (SLIPR)
31 ;
32 ; MACRO LIBRARY CALLS
33 ;
34
35 .MCALL GCMLD$
36 000000 GCMLD$ ;DEFINE GET COMMAND LINE CONTROL BLOCK
37
38 ;
39 ; EQUATED SYMBOLS
40 ;
41 ; OPTION SWITCH WORD BIT DEFINITIONS
42 ;
43
44 000001 AP$ND==000001 ;APPEND ";**-NEW**" AND COMPRESS (0=YES)
45 000002 DB$LL==000002 ;DOUBLE SPACE LINE LISTING (1=YES)
46 000004 DE$LF==000004 ;DELETE CORECTION INPUT FILE (1=YES)
47 000010 ID$RT==000010 ;INDIRECT FILE RECOGNIZATION (0=YES)
48 000020 CR$FI==000020 ;CORECTION INPUT FILE SPECIFIED (1=YES)
49 000040 LL$ST==000040 ;LINE LISTING FILE SPECIFIED (1=YES)
50 000100 SR$CO==000100 ;SOURCE OUTPUT FILE SPECIFIED (1=YES)
51 000200 BL$NK==000200 ;BLANK FILL TO PAD LINES (0=YES)
52 000400 SP$OL==000400 ;SPOOL LISTING FILE (0=YES)
53
54 ;
55 ; MACRO LIBRARY CALLS
56 ;
57
SLPR11 MACRO M1108 05-DEC-77 23:51 PAGE 2-1
58 .MCALL CLOSE$,DELET$,EXIT$S,FINIT$,PUT$
59
60 ;
61 ; LOCAL DATA
62 ;
63 ; MISC VARIABLES-ADJACENCY ASSUMED
64 ;
65
66 000000 $AULGH::.BLKW 1 ;LENGTH OF AUDIT SEGMENT ; CM001
67 000002 $CFNMB::.BLKW 1 ;CORRECTION INPUT FILE LINE NUMBER
68 000004 $CMFLG::.BLKW 1 ;COMMAND INPUT SOLICATION FLAG
69 000006 $LNDEL::.BLKW 1 ;NUMBER OF LINES DELETED
70 000010 $LNUMB::.BLKW 1 ;CURRENT LINE NUMBER
71 000012 $PDSIZ::.BLKW 1 ;PAD SPECIFIED BY USER ; CM001
72 000014 $PDLGH::.BLKW 1 ;LENGTH OF PAD FIELD ; CM001
73 000016 $PLNMB::.BLKW 1 ;LINE IN CURRENT PAGE
74 000020 $SWTCH::.BLKW 1 ;OPTION SWITCH WORD
75 000022 $HDSIZ::.BLKW 1 ;SIZE OF HEADING IN BYTES
76 000024 000026' .WORD $HEADG ;HEADER BUFFER POINTER ; CM001
77 000026 $HEADG::.BLKW 46. ;PAGE HEADING
78 000162 $OUTBF::.BLKW 40. ;ERROR MESSAGE OUTPUT BUFFER
79 000302 TEMP: .BLKB 100 ;TEMP CSI BUFFER ; CM001
80 000402 SPSAV: .BLKW 1 ;INITIAL SP VALUE
81
82 ;
83 ; FORM CONTROL
84 ;
85
86 000404 014 FORM: .BYTE 14 ;FORM FEED
87
88 ;
89 ; CONTROL BYTE STRING
90 ;
91
92 000405 074 057 055 CNTRL: .BYTE '<,'/,'-,'%,'\ ; ; CM001
000410 045 134
93 ; CM001
94 ; ; CM001
95 ; INITIAL LINE SUFFIX ; CM001
96 ; ; CM001
97 ; CM001
98 000412 073 052 052 NEW: .ASCIZ /;**NEW**/ ; ; CM001
000415 116 105 127
000420 052 052 000
99
100 .EVEN
101
102 ; ; CM001
103 ; USER AUDIT TRAIL ; CM001
104 ; ; CM001
105 000000 .PSECT $$AUD0,D,OVR
106 000000 $NEW:: ; ; CM001
107 .BLKB 8. ;
108 000000 .PSECT $$AUD1,D
109 000000 000 ENEW: .BYTE 0 ; ; CM001
110
111 .EVEN
SLPR11 MACRO M1108 05-DEC-77 23:51 PAGE 2-2
112
113 000424 .PSECT
114
115
116 ;-
117 ; **-$SLIPR-SOURCE LANGUAGE INPUT PROGRAM
118 ;-
119
120 000424 $SLIPR::FINIT$ ;INITIALIZE FILE STORAGE REGION
121 000430 016700 000000G MOV $CMIPT,R0 ;GET COMMAND INPUT RECORD BLOCK ADDRESS
122 000434 142760 000004 000141 BICB #GE.CLO,G.MODE(R0) ;CLEAR CLOSE AFTER BIT
123 000442 010667 177734 MOV SP,SPSAV ;SAVE INITIAL SP VALUE
124 000446 012703 000020' SLIPR1: MOV #$SWTCH,R3 ;GET ADDRESS OF SWITCH OPTION WORD
125 000452 016706 177724 MOV SPSAV,SP ;SET INITIAL SP VALUE
126 000456 012700 000002' MOV #$CFNMB,R0 ;GET ADDRESS OF MISC DATA
127 000462 012701 000011 MOV #<$HDSIZ-$CFNMB>/2+1,R1 ; GET NUMBER TO CLEAR ; CM001
128 000466 005020 5$: CLR (R0)+ ; CLEAR SPECIFIED LOCATIONS ; CM001
129 000470 005301 DEC R1 ; DECREMENT COUNT ; CM001
130 000472 001375 BNE 5$ ; IF NE GO AGAIN ; CM001
131 000474 052713 000001 BIS #AP$ND,(R3) ; SURPRESS AUDIT TRAIL
132 000500 CALL $GTCML ;GET COMMAND INPUT LINE
133 000504 103002 SLIPR3: BCC 10$ ;IF CC OKAY
134 000506 000167 000472 JMP SLPXT ;EXIT
135 000512 10$: CALL $CMPRS ;COMPRESS LINE
136 000516 005013 CLR (R3) ;SET INITIAL OPTION SWITCH WORD
137 000520 012767 000000C 177266 MOV #L$LGTH-A$UDEF+7&^C7,$PDLGH ; SET DEFAULT MARGIN ; CM001
138 000526 012767 000000G 177244 MOV #A$UDEF,$AULGH ; SET DEFAULT AUDIT FIELD SIZE ; CM001
139 000534 012700 000000G MOV #$LNDES,R0 ;GET ADDRESS OF LINE DESCRIPTOR
140 000540 005710 TST (R0) ;NULL LINE?
141 000542 001741 BEQ SLIPR1 ;IF EQ YES
142 000544 122767 000057 000000G CMPB #'/,$LNBUF ;EXIT COMMAND?
143 000552 001002 BNE 20$ ;IF NE CONTINUE
144 000554 000167 000424 JMP SLPXT ;EXIT
145 000560 012701 000302' 20$: MOV #TEMP,R1 ;GET ADDRESS OF CSI BUFFER
146 000564 CALL $SYNTX ;ANALYZE SYNTAX OF LINE
147 000570 103726 BCS SLIPR1 ;IF CS SYNTAX ERROR
148 000572 016700 000000G MOV $SRCPT,R0 ;GET SOURCE OUTPUT RECORD BLOCK
149 000576 012701 000302' MOV #TEMP,R1 ;GET ADDRESS OF CSI BLOCK
150 000602 CALL $SCANO ;SCAN FOR OUTPUT FILE
151 000606 103402 BCS 31$ ;IF CS NO OUTPUT FILE
152 000610 052713 000100 BIS #SR$CO,(R3) ;SET SOURCE OUTPUT BIT
153 000614 016700 000000G 31$: MOV $LSTPT,R0 ;GET LINE LISTING RECORD BLOCK
154 000620 012701 000302' MOV #TEMP,R1 ;GET ADDRESS OF CSI BLOCK
155 000624 CALL $SCANO ;SCAN FOR OUTPUT FILE
156 000630 103414 BCS 4$ ;IF CS NO OUTPUT FILE
157 000632 052713 000040 BIS #LL$ST,(R3) ;SET LINE LISTING BIT
158 000636 PUT$ $LSTPT,#FORM,#1 ;OUTPUT A FORM FEED
159 000662 016700 000000G 4$: MOV $CFIPT,R0 ;GET CORRECTION INPUT FILE RECORD BLOCK
160 000666 012701 000302' MOV #TEMP,R1 ;GET ADDRESS OF CSI BLOCK
161 000672 CALL $SCANI ;SCAN FOR INPUT FILE
162 000676 103402 BCS 5$ ;IF CS NO INPUT FILE
163 000700 052713 000020 BIS #CR$FI,(R3) ;SET CORRECTION FILE BIT
164 000704 032713 000160 5$: BIT #CR$FI!LL$ST!SR$CO,(R3);ANY FILE SPECIFIED?
165 000710 001656 BEQ SLIPR1 ;IF EQ NO-IGNOR LINE
166 000712 CALL $OPNFL ;OPEN ALL FILES
167 000716 103002 BCC 51$ ; IF C/C OK ; CM001
168 000720 000167 000160 JMP $RSTRT ; ELSE RESTART ; CM001
SLPR11 MACRO M1108 05-DEC-77 23:51 PAGE 2-3
169 000724 012700 000000G 51$: MOV #$LNDES,R0 ; GET LINE DESCRIPTOR ADDRESS ; CM001
170 000730 012067 177066 MOV (R0)+,$HDSIZ ;SET SIZE OF HEADING IN BYTES
171 000734 062767 000010 177060 ADD #10,$HDSIZ ;ALLOW FOR LINE SPACING CHARACTERS
172 000742 011000 MOV (R0),R0 ;GET ADDRESS OF LINE BUFFER
173 000744 012701 000026' MOV #$HEADG,R1 ;GET ADDRESS OF HEADING BUFFER
174 000750 112021 6$: MOVB (R0)+,(R1)+ ;MOVE LINE TO HEADING
175 000752 001376 BNE 6$ ;
176 000754 005301 DEC R1 ;BACK UP R1
177 000756 012700 MOV (PC)+,R0 ;GET CR,LF
178 000760 015 012 .BYTE 15,12 ;
179 000762 012702 000010 MOV #10,R2 ;SET REPEAT COUNT
180 000766 110021 61$: MOVB R0,(R1)+ ;STORE A BYTE
181 000770 000300 SWAB R0 ;SWAP HALVES
182 000772 005302 DEC R2 ;REPEAT?
183 000774 003374 BGT 61$ ;IF GT YES
184 000776 005267 177002 INC $CMFLG ;SET NON COMMAND INPUT
185 001002 026727 176772 000000C CMP $AULGH,#ENEW-$NEW ; LEGAL AUDIT LENGTH? ; CM001
186 001010 101022 BHI 90$ ;IF HI NO ; CM001
187 001012 012700 000012' 60$: MOV #$PDSIZ,R0 ;GET LENGTH OF PAD FIELD ; CM001
188 001016 005720 TST (R0)+ ;PAD FIELD SPECIFIED? ; CM001
189 001020 001402 BEQ 63$ ;IF EQ NO ; CM001
190 001022 016010 177776 MOV -2(R0),(R0) ;SET UP MARGIN ; CM001
191 001026 062710 000007 63$: ADD #7,(R0) ;ROUND UP TO NEXT TAB LIMIT ; CM001
192 001032 103411 BCS 90$ ;IF C/S ERROR ; CM001
193 001034 042710 000007 BIC #7,(R0) ;CLEAR EXCESS ; CM001
194 001040 016701 176734 MOV $AULGH,R1 ;GET AUDIT FIELD SIZE ; CM001
195 001044 061001 ADD (R0),R1 ;ADD PAD LENGTH ; CM001
196 001046 103403 BCS 90$ ;IF C/S ERROR ; CM001
197 001050 020127 000000G CMP R1,#L$LGTH ;LEGAL LENGTH ; CM001
198 001054 101402 BLOS 95$ ;IF LOS YES ; CM001
199 001056 90$: ; ; CM001
200 001056 000167 000102 JMP ERXT ;ELSE ERROR ; CM001
201 001062 95$: ; ; CM001
202 001062 012700 000412' MOV #NEW,R0 ;GET ADDRESS OF DEFAULT AUDIT TRAIL ; CM001
203 001066 012701 000000' MOV #$NEW,R1 ;GET ADDRESS OF BUFFER ; CM001
204 001072 112021 100$: MOVB (R0)+,(R1)+ ;SETUP STRING ; CM001
205 001074 001376 BNE 100$ ; LOOP UNTIL END OF STRING ; CM001
206 001076 CALL SLPR11 ;CALL EDITOR
207 001102 103440 BCS SLPXT ;IF CS EXIT
208 ; BIT #SP$OL,$SWTCH ;SPOOL OUTPUT?
209 ; BNE $RSTRT ;IF NE NO
210 ; PRINT$ $LSTPT ;PRINT LISTING FILE
211 001104 032767 000004 176706 $RSTRT::BIT #DE$LF,$SWTCH ;DELETE CORRECTION INPUT FILE?
212 001112 001404 BEQ 10$ ;IF EQ NO
213 001114 DELET$ $CFIPT ;DELETE CORRECTION INPUT FILE
214 001124 10$: CLOSE$ $CFIPT ;CLOSE CORRECTION INPUT FILE
215 001134 CLOSE$ $LSTPT ;CLOSE LINE LISTING FILE
216 001144 CLOSE$ $SRCPT ;CLOSE SOURCE OUTPUT FILE
217 001154 005067 176624 CLR $CMFLG ;FORCE PROMPT OUTPUT
218 001160 000167 177262 JMP SLIPR1 ;GO AGAIN
219
220 ;
221 ; ERROR EXIT
222 ;
223
224 001164 012702 000000G ERXT: MOV #$LNDES,R2 ;GET ADDRESS OF LINE DESCIPTOR ; CM001
225 001170 012701 000000C MOV #S$V2*400!E$R14,R1 ;GET ERROR, SEVERITY ; CM001
SLPR11 MACRO M1108 05-DEC-77 23:51 PAGE 2-4
226 001174 CALL $ERMSG ; ISSUE ERROR MESSAGE ; CM001
227 001200 000167 000052 JMP SLPR1 ; GO AGAIN ; CM001
228
229
230 ;
231 ; EXIT SEQUENCE
232 ;
233
234 001204 SLPXT: CLOSE$ $CFIPT ;CLOSE CORRECTION INPUT FILE
235 001214 CLOSE$ $CMIPT ;CLOSE COMMAND INPUT FILE
236 001224 CLOSE$ $LSTPT ;CLOSE LINE LISTING FILE
237 001234 CLOSE$ $SRCPT ;CLOSE SOURCE OUTPUT FILE
238 001244 EXIT$S ;EXIT TO SYSTEM
239
240 ;+
241 ; **-MAIN BODY OF ACTUAL EDITOR
242 ;
243 ; INPUTS:
244 ;
245 ; R3=ADDRESS OF OPTION SWITCH WORD.
246 ;
247 ; OUTPUTS:
248 ;
249 ; C=1 IF PREMATURE EOF OR ERROR ON COMMAND INPUT FILE.
250 ; C=0 IF SUCESSFUL REQUEST.
251 ;-
252
253 001252 SLPR11: SAVRG ;SAVE NONVOLITILE REGISTERS
254 001256 SLPR1: CALL $GTCML ;GET COMMAND INPUT LINE
255 001262 103423 BCS 1$ ;IF CS EOF OR ERROR
256 001264 012700 000000G MOV #$LNBUF,R0 ;GET ADDRESS OF LINE BUFFER
257 001270 112005 MOVB (R0)+,R5 ;GET FIRST BYTE
258 001272 012704 000405' MOV #CNTRL,R4 ;GET ADDRESS OF CONTROL BYTE STRING
259 001276 JOL 2$ ;SHIFT?
260 001302 JOL 4$ ;FILE MARK?
261 001306 032713 000020 BIT #CR$FI,(R3) ;CORRECTION INPUT FILE?
262 001312 001422 BEQ 3$ ;IF EQ NO
263 001314 JOL 6$ ;MINUS?
264 001320 JOL 7$ ;ENABLE AUDIT TRAIL? ; CM001
265 001324 JOL 8$ ;DISABLE AUDIT TRAIL? ; CM001
266 001330 000413 BR 3$ ;
267
268 ;
269 ; EOF OR ERROR ON COMMAND INPUT FILE
270 ;
271
272 001332 005002 1$: CLR R2 ;SET DUMMY PARAMETER BLOCK ADDRESS
273 001334 012701 MOV (PC)+,R1 ;PREMATURE EOF OR ERROR
274 001336 000G 000G .BYTE E$R15,S$V0 ;DIAGNOSTIC
275 001340 CALL $ERMSG ;OUTPUT ERROR MESSAGE
276 001344 CALL $COPYF ;COPY REMAINDER OF CORRECTION FILE
277 001350 000261 SEC ;SET CARRY
278 001352 000410 BR 5$ ;COMMON EXIT
279
280 ;
281 ; SHIFT COMMAND (<)
282 ;
SLPR11 MACRO M1108 05-DEC-77 23:51 PAGE 2-5
283
284 001354 2$: CALL $SHIFT ;SHIFT LINE LEFT ONE CHARACTER
285 001360 3$: CALL $PUTLN ;PUT LINE IN OUTPUT FILES
286 001364 000734 BR SLPR1 ;GO AGAIN
287
288 ;
289 ; FILE MARK (/)
290 ;
291
292 001366 4$: CALL $COPYF ;COPY REMAINDER OF FILE
293 001372 000241 CLC ;CLEAR CARRY
294 001374 5$: RETURN ;
295
296 ;
297 ; POSITION/DELETION COMMAND (-N OR -N,M)
298 ;
299
300 001376 6$: CALL $POSIT ;POSITION FILE
301 001402 000725 BR SLPR1 ;CONTINUE
302
303 ; ; CM001
304 ; ENABLE AUDIT TRAIL (%) ; CM001
305 ; ; CM001
306 ; CM001
307 001404 032713 000001 7$: BIT #AP$ND,(R3) ;AUDIT TRAIL ENABLED?
308 001410 001722 BEQ SLPR1 ;IF EQ YES, CONTINUE
309 001412 005067 176370 CLR $LNDEL ;CLEAR DELETION COUNT
310 001416 042713 000001 BIC #AP$ND,(R3) ;ENABLE AUDIT TRAIL
311 001422 000715 BR SLPR1 ;CONTINUE
312
313 ;
314 ; DISABLE AUDIT TRAIL (\) ; CM001
315 ;
316
317 001424 052713 000001 8$: BIS #AP$ND,(R3) ;DISABLE AUDIT TRAIL ; CM001
318 001430 000712 BR SLPR1 ;CONTINUE ; CM001
319
320 000424' .END $SLIPR
SLPR11 MACRO M1108 05-DEC-77 23:51 PAGE 2-6
SYMBOL TABLE
AP$ND = 000001 G GE.IOR= 177777 SLPR11 001252R $CMFLG 000004RG $PLNMB 000016RG
A$UDEF= ****** GX GE.LC = 000010 SLPXT 001204R $CMIPT= ****** GX $POSIT= ****** GX
BL$NK = 000200 G GE.MDE= 177774 SPSAV 000402R $CMPRS= ****** GX $PUTLN= ****** GX
CNTRL 000405R GE.OPR= 177776 SP$OL = 000400 G $COPYF= ****** GX $RSTRT 001104RG
CR$FI = 000020 G G.CMLD= 000146 SR$CO = 000100 G $ERMSG= ****** GX $SAVRG= ****** GX
DB$LL = 000002 G G.DPRM= 000160 S$V0 = ****** GX $GTCML= ****** GX $SCANI= ****** GX
DE$LF = 000004 G G.ERR = 000140 S$V2 = ****** GX $HDSIZ 000022RG $SCANO= ****** GX
ENEW 000000R 003 G.ISIZ= 000020 S.FDB = 000140 $HEADG 000026RG $SHIFT= ****** GX
ERXT 001164R G.MODE= 000141 S.FNAM= 000006 $LNBUF= ****** GX $SLIPR 000424RG
E$R14 = ****** GX G.PSDS= 000142 S.FNB = 000036 $LNDEL 000006RG $SRCPT= ****** GX
E$R15 = ****** GX ID$RT = 000010 G S.FNBW= 000017 $LNDES= ****** GX $SWTCH 000020RG
FORM 000404R LL$ST = 000040 G S.FNTY= 000004 $LNUMB 000010RG $SYNTX= ****** GX
F.NRBD= ****** GX L$LGTH= ****** GX S.FTYP= 000002 $LSTPT= ****** GX $$ = 000001
GE.BIF= 177775 NEW 000412R S.NFEN= 000020 $NEW 000000RG 002 .CLOSE= ****** G
GE.CLO= 000004 PAR$$$= 000067 TEMP 000302R $OPNFL= ****** GX .DELET= ****** G
GE.COM= 000001 SLIPR1 000446R $AULGH 000000RG $OUTBF 000162RG .FINIT= ****** G
GE.EOF= 177766 SLIPR3 000504R $CFIPT= ****** GX $PDLGH 000014RG .PUT = ****** G
GE.IND= 000002 SLPR1 001256R $CFNMB 000002RG $PDSIZ 000012RG ...TPC= 000140
. ABS. 000000 000
001432 001
$$AUD0 000010 002
$$AUD1 000002 003
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 2464 WORDS ( 10 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:30
[61,10]SLPR11,[61,20]SLPR11/-SP=[61,30]MACFL,SLPR11
SLPSB MACRO M1108 05-DEC-77 23:51 PAGE 2
1 .TITLE SLPSB
2 .IDENT /05/ ; CM001
3
4 ;
5 ; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
6 ; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
9 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
10 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
11 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
12 ;
13 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
14 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
15 ; EQUIPMENT CORPORATION.
16 ;
17 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
18 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
19 ;
20 ; VERSION 05 ; CM001
21 ;
22 ; D.N. CUTLER 4-JAN-72
23 ;
24 ; MODIFICATIONS:
25 ;
26 ; C. MONIA 11-SEP-75
27 ;
28 ; CM001 -- ADD USER SPECIFIED AUDIT TRAIL
29 ;
30 ;
31 ; MACRO LIBRARY CALLS
32 ;
33
34 .MCALL GET$
35
36 ;+
37 ; **-$COPYF-COPY FILE
38 ;
39 ; THIS ROUTINE IS CALLED TO COPY THE REMAINDER OF THE CORRECTION INPUT
40 ; FILE INTO THE SOURCE OUTPUT FILE.
41 ;
42 ; INPUTS:
43 ;
44 ; R3=ADDRESS OF OPTION SWITCH WORD.
45 ;
46 ; OUTPUTS:
47 ;
48 ; NONE.
49 ;-
50
51 000000 032713 000000G $COPYF::BIT #CR$FI,(R3) ;ANY CORRECTION INPUT FILE?
52 000004 001403 BEQ 2$ ;IF EQ NO
53 000006 1$: CALL $COPYL ;COPY A LINE
54 000012 103375 BCC 1$ ;IF CC GO AGAIN
55 000014 2$: RETURN ;
56
57 ;+
SLPSB MACRO M1108 05-DEC-77 23:51 PAGE 2-1
58 ; **-$COPYL-COPY LINE
59 ;
60 ; THIS ROUTINE IS CALLED TO COPY A LINE FROM THE CORRECTION INPUT FILE
61 ; TO THE SOURCE OUTPUT FILE. COMPRESS IS CALLED IF THE LINE IS TO BE
62 ; COMPRESSED BEFORE IT IS WRITTEN INTO THE SOURCE OUTPUT FILE.
63 ;
64 ; INPUTS:
65 ;
66 ; NONE.
67 ;
68 ; OUTPUTS:
69 ;
70 ; C=1 IF EOF OR ERROR ON CORRECTION INPUT FILE.
71 ; C=0 IF LINE IS COPIED SUCESSFULLY.
72 ;-
73
74 000016 $COPYL::CALL $GTCFL ;GET LINE FROM CORRECTION INPUT FILE
75 000022 103411 BCS 2$ ;IF CS EOF OR ERROR
76 000024 032767 000000G 000000G BIT #AP$ND,$SWTCH ;COMPRESS LINE?
77 000032 001002 BNE 1$ ;IF NE NO
78 000034 CALL $CMPRS ;COMPRESS LINE
79 000040 1$: CALL $PUTLN ;PUT LINE IN SOURCE OUTPUT FILE
80 000044 000241 CLC ;CLEAR CARRY
81 000046 2$: RETURN ;
82
83 ;+
84 ; **-$GTCFL-GET LINE FROM CORRECTION INPUT FILE
85 ;
86 ; THIS ROUTINE IS CALLED TO GET THE NEXT LINE FROM THE CORRECTION
87 ; INPUT FILE. $GETLN IS CALLED TO READ THE LINE.
88 ;
89 ; INPUTS:
90 ;
91 ; NONE.
92 ;
93 ; OUTPUTS:
94 ;
95 ; C=1 IF EOF OR ERROR ON RECORD READ
96 ; C=0 IF SUCESSFUL REQUEST
97 ; $CFNMB IS INCREMENTED.
98 ;-
99
100 000050 016700 000000G $GTCFL::MOV $CFIPT,R0 ;GET CORRECTION INPUT FILE RECORD BLOCK
101 000054 GET$ R0 ;GET NEXT RECORD
102 000060 103014 BCC 20$ ;IF CC OKAY
103 000062 122760 177766 000000G CMPB #-10.,F.ERR(R0) ;EOF?
104 000070 001406 BEQ 10$ ;IF EQ YES
105 000072 016002 000000G MOV R$NAME(R0),R2 ;GET ADDRESS OF NAME STRING
106 000076 012701 MOV (PC)+,R1 ;CORRECTION FILE I/O ERROR
107 000100 000G 000G .BYTE E$R16,S$V0 ;DIAGNOSTIC
108 000102 CALL $ERMSG ;OUTPUT ERROR MESSAGE
109 000106 000261 10$: SEC ;SET CARRY
110 000110 000406 BR 30$ ;
111 000112 062700 000000G 20$: ADD #F.NRBD,R0 ;POINT TO LINE DESCRIPTOR
112 000116 CALL $GETLN ;GET NEXT LINE FROM FILE
113 000122 005267 000000G INC $CFNMB ;INC CORRECTION FILE LINE NUMBER
114 000126 30$: RETURN ;
SLPSB MACRO M1108 05-DEC-77 23:51 PAGE 2-2
115
116 ;+
117 ; **-$PADLN-PAD LINE
118 ;
119 ; THIS ROUTINE IS CALLED TO PAD A LINE TO THE RIGHT MARGIN.
120 ;
121 ; INPUTS:
122 ;
123 ; R0=ADDRESS OF NEXT BYTE IN OUTPUT LINE.
124 ; R1=HORIZONAL POSITION OF LINE.
125 ;
126 ; OUTPUTS:
127 ;
128 ; R0=ADDRESS OF NEXT BYTE IN OUTPUT LINE.
129 ;-
130
131 000130 016702 000000G $PADLN::MOV $PDLGH,R2 ;GET LENGTH OF MARGIN ; CM001
132 000134 020102 CMP R1,R2 ;ANY MORE ROOM? ; CM001
133 000136 002017 BGE 20$ ;IF GE NO
134 000140 032767 000000G 000000G BIT #BL$NK,$SWTCH ;BLANK FILL?
135 000146 001407 BEQ 10$ ;IF EQ YES
136 000150 042701 000007 BIC #7,R1 ;CLEAR EXCESS BITS
137 000154 062701 000010 ADD #10,R1 ;CALCULATE NEXT TAB STOP
138 000160 112720 000011 MOVB #11,(R0)+ ;STORE A TAB
139 000164 000761 BR $PADLN ;
140 000166 005201 10$: INC R1 ;INCREMENT HORIZONAL POSITION
141 000170 112720 000040 MOVB #' ,(R0)+ ;INSERT A BLANK
142 000174 000755 BR $PADLN ;GO AGAIN
143 000176 060200 20$: ADD R2,R0 ;ADD OFFSET TO MARGIN ; CM001
144 000200 160100 SUB R1,R0 ;SUBTRACT HORIZONTAL POSITION ; CM001
145 000202 010201 MOV R2,R1 ;SET NEW HORIZONTAL POSITION ; CM001
146 000204 RETURN ; ; CM001
147
148 ;+
149 ; **-$SHIFT-SHIFT LINE
150 ;
151 ; THIS ROUTINE IS CALLED TO SHIFT THE LINE IN $LNBUF LEFT ONE CHARACTER.
152 ;
153 ; INPUTS:
154 ;
155 ; R0=ADDRESS OF SECOND CHARACTER IN $LNBUF.
156 ; $LNBUF CONTAINS LINE TO BE SHIFTED.
157 ;
158 ; OUTPUTS:
159 ;
160 ; $LNBUF IS SHIFTED LEFT ONE CHARACTER.
161 ;-
162
163 000206 012701 000000G $SHIFT::MOV #$LNBUF,R1 ;GET ADDRESS OF LINE BUFFER
164 000212 112021 1$: MOVB (R0)+,(R1)+ ;MOVE A BYTE
165 000214 001376 BNE 1$ ;IF NE GO AGAIN
166 000216 005367 000000G DEC $LNDES ;DECREMENT ACTUAL NUMBER OF BYTES
167 000222 RETURN ;
168
169 000001 .END
SLPSB MACRO M1108 05-DEC-77 23:51 PAGE 2-3
SYMBOL TABLE
AP$ND = ****** GX PAR$$$= 000000 $CMPRS= ****** GX $GTCFL 000050RG $PUTLN= ****** GX
BL$NK = ****** GX R$NAME= ****** GX $COPYF 000000RG $LNBUF= ****** GX $SHIFT 000206RG
CR$FI = ****** GX S$V0 = ****** GX $COPYL 000016RG $LNDES= ****** GX $SWTCH= ****** GX
E$R16 = ****** GX $CFIPT= ****** GX $ERMSG= ****** GX $PADLN 000130RG $$ = 000001
F.ERR = ****** GX $CFNMB= ****** GX $GETLN= ****** GX $PDLGH= ****** GX .GET = ****** G
F.NRBD= ****** GX
. ABS. 000000 000
000224 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 873 WORDS ( 4 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:09
[61,10]SLPSB,[61,20]SLPSB/-SP=[61,30]MACFL,SLPSB
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52
TABLE OF CONTENTS
1- 5 TITLE PAGE
2- 28 MACRO DEFINITIONS
2- 63 IMPURE DATA
3- 84 MAIN ROUTINE BODY
4- 239 COMPLEX TYPE ROUTINES
5- 321 GET STRING ROUTINE
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 1
1 .TITLE .TPARS - TABLE DRIVEN FINITE STATE PARSER
2
3 .IDENT "V0117"
4
5 .SBTTL TITLE PAGE
6
7 ;
8 ; COPYRIGHT (C) 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
9 ; COPYRIGHT (C) 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
10 ;
11 ; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
12 ; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
13 ; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
14 ; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
15 ;
16 ; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
17 ; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
18 ; EQUIPMENT CORPORATION.
19 ;
20 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
21 ; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
22 ;
23 ; ANDREW C. GOLDSTEIN 2 OCT 75 16:31
24
25
26 ; R$$EIS = 0 ; USE EIS
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 2
MACRO DEFINITIONS
28 .SBTTL MACRO DEFINITIONS
29
30 .MCALL CALL,RETURN
31 ;
32 ; INTERNAL MACROS
33 ;
34 .MACRO PUSH LIST
35 .IRP RX,<LIST>
36 MOV RX,-(SP)
37 .ENDM
38 .ENDM PUSH
39
40 .MACRO POP LIST
41 .IRP RX,<LIST>
42 MOV (SP)+,RX
43 .ENDM
44 .ENDM POP
45 ;
46 ; MACRO TO DO SOB'S ON SMALL MACHINES
47 ;
48 .IF NDF R$$EIS
49 .MACRO SOB RX,LABEL
50 DEC RX
51 BNE LABEL
52 .ENDM SOB
53 .ENDC
54 ;
55 ; RANDOM CHARACTERS
56 ;
57 000011 TAB= 11
58 000015 CR= 15
59 000033 AM= 33
60 000040 SPA= 40
61
62
63 .SBTTL IMPURE DATA
64
65 000000 .PSECT IMPURE,D
66 ;
67 ; ***** DO NOT CHANGE THE ORDER OF THE FOLLOWING VARIABLES!
68 ;
69 ; ITEMS OF INTEREST TO ACTION ROUTINES AND THE OUTSIDE WORLD
70 ; IN GENERAL.
71 ;
72 000000 .PFLAG::.BLKW 1 ; SAVED FLAG WORD
73 000002 .PSTCN::.BLKW 1 ; CHARACTER COUNT OF FOUND STRING
74 000004 .PSTPT::.BLKW 1 ; POINTER TO FOUND STRING
75 000006 .PCHAR::.BLKW 1 ; FOUND CHARACTER
76
77 000010 .PNUMH::.BLKW 1 ; HIGH ORDER VALUE AND ....
78 000012 .PNUMB::.BLKW 1 ; LOW ORDER VALUE OF FOUND NUMBER
79 ;
80 ; ***** DO NOT CHANGE THE ORDER OF THE PRECEDING VARIABLES!
81 ;
82 000000 .PSECT
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 3
MAIN ROUTINE BODY
84 .SBTTL MAIN ROUTINE BODY
85
86 ;+
87 ;
88 ; *** - .TPARS
89 ;
90 ; ENTRY: CALL .TPARS
91 ;
92 ; INPUTS:
93 ;
94 ; R1 = 0 IGNORE ALL SPACES BETWEEN SYNTACTIC ELEMENTS
95 ; >< 0 TREAT SPACES AS SIGNIFICANT CHARACTERS
96 ; R2 = POINTER TO KEYWORD TABLE
97 ; R3 = LENGTH OF COMMAND STRING
98 ; R4 = ADDRESS OF COMMAND STRING
99 ; R5 = INITIAL STATE POINTER
100 ;
101 ; OUTPUTS:
102 ;
103 ; C = 0 SUCCESSFUL PARSE
104 ; C = 1 SYNTAX OR STATE TABLE ERROR
105 ; R3 = NUMBER OF CHARACTERS NOT SCANNED
106 ; R4 = POINTER TO UNSCANNED PART OF COMMAND STRING
107 ;
108 ; ALL OTHER REGISTERS ARE PRESERVED.
109 ;
110 ; .TPARS PARSES THE COMMAND STRING ACCORDING TO THE FINITE
111 ; STATE MACHINE REPRESENTED IN THE STATE AND KEYWORD TABLES
112 ; SUPPLIED BY THE CALLER. USER SUPPLIED ACTION ROUTINES ARE
113 ; CALLED AS SPECIFIED.
114 ;
115 ;-
116
117
118 .ENABL LSB
119
120 000000 .TPARS::
121 000000 PUSH <R0,R5,R2> ; SAVE REGISTERS
122 000006 010167 000000' MOV R1,.PFLAG ; SAVE FLAG WORD
123 ;
124 ; ENTER THE STATE SPECIFIED IN R5 AND
125 ; EVALUATE POSSIBLE STATE TRANSITIONS
126 ;
127 000012 005767 000000' TSTAT: TST .PFLAG ; CHECK SPACE FLUSH FLAG
128 000016 001002 BNE 10$
129 000020 CALL GETSP ; EAT SPACES IF FLAG IS ZERO
130 000024 005067 000002' 10$: CLR .PSTCN ; KILL ANY OLD STRING
131 000030 010467 000004' MOV R4,.PSTPT ; INIT STRING POINTER
132 000034 112500 MOVB (R5)+,R0 ; GET TYPE BYTE
133 000036 100054 BPL TSCHAR ; BIT 7 = 0 - MATCH SPECIFIED CHAR
134 000040 162700 177700 SUB #177700,R0 ; TEST AGAINST 300
135 000044 002556 BLT DOKEY ; 200 - 277 - MATCH KEYWORD
136 000046 020027 000024 CMP R0,#MAXTYP ; CHECK TYPE CODE FOR LEGALITY
137 000052 003035 BGT SYNERR ; TOO HIGH - OUT
138 000054 010001 MOV R0,R1 ; GARBAGE R1 FOR USE AS A FLAG
139 000056 060007 ADD R0,PC ; AND DISPATCH ON IT
140 000060 000455 BR DOLAMB ; $LAMDA = 300 - MATCH EMPTY
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 3-1
MAIN ROUTINE BODY
141 000062 000574 BR DONUMB ; $NUMBR = 302 - MATCH NUMBER
142 000064 000536 BR DOSTRG ; $STRNG = 304 - MATCH ANY STRING
143 000066 000540 BR DOBLNK ; $BLANK = 306 - MATCH ANY SET OF BLANKS
144 000070 000507 BR DOSUBR ; $SUBXP = 310 - MATCH A SUBEXPRESSION
145 000072 000405 BR DOENDS ; $EOS = 312 - MATCH END OF STRING
146 000074 000566 BR DODNMB ; $DNUMB = 314 - MATCH DECIMAL NUMBER
147 000076 000530 BR DORD50 ; $RAD50 = 316 - MATCH RAD-50 STRING
148 000100 000435 BR DOCHAR ; $ANY = 320 - MATCH ANY CHARACTER
149 000102 000423 BR DOALPH ; $ALPHA = 322 - MATCH SINGLE ALPHABETIC
150 000104 000425 BR DODIGT ; $DIGIT = 324 - MATCH SINGLE DIGIT
151 ;
152 ; NOTE - IT IS CRITICAL THAT R0 AND R1 BE NON-ZERO AND POSITIVE AT THE DISPATCH
153 ;
154 000024 MAXTYP = 24
155 ;
156 ; CHECK FOR END OF STRING
157 ;
158 000106 005703 DOENDS: TST R3 ; CHECK CHAR COUNT
159 000110 001441 BEQ DOTRAN ; YES
160 ;
161 ; TYPE MATCH FAILED - TRY NEXT ENTRY IN TRANSITION TABLE
162 ;
163 000112 066703 000002' NXTRAN: ADD .PSTCN,R3 ; RETURN ANY STRING
164 000116 166704 000002' SUB .PSTCN,R4 ; TO THE COMMAND LINE
165 000122 112500 MOVB (R5)+,R0 ; GET FLAGS BYTE
166 000124 002410 BLT SYNERR ; THIS WAS LAST TRANSITION - YOU LOSE
167 000126 012701 000005 MOV #5,R1 ; COUNT OF FLAG BITS TO TEST
168 000132 006000 20$: ROR R0 ; CHECK FLAG BIT
169 000134 103001 BCC 30$
170 000136 005725 TST (R5)+ ; SKIP POINTER WORD
171 000140 30$: SOB R1,20$ ; COUNT BITS
172 000144 000722 BR TSTAT ; TRY NEXT TRANSITION
173 ;
174 ; OUT OF TRANSITION TABLE ENTRIES, OR SOME OTHER ANOMALY,
175 ; LIKE A BAD TYPE CODE. ALL ARE SYNTAX ERRORS.
176 ;
177 000146 000261 SYNERR: SEC ; SAY SO
178 000150 000451 BR EXIT ; AND QUIT
179 ;
180 ; TEST FOR SINGLE ALPHABETIC
181 ;
182 000152 DOALPH: CALL GETALP ; PICK UP CHAR IF PRESENT
183 000156 000402 BR 40$
184 ;
185 ; TEST FOR SINGLE DIGIT
186 ;
187 000160 DODIGT: CALL GETDIG ; PICK UP DIGIT IF PRESENT
188 000164 103003 40$: BCC DOCHAR ; ACCEPT THE CHAR
189 000166 000751 BR NXTRAN ; NO - TRY ANOTHER
190 ;
191 ; TEST FOR SPECIFIED CHARACTER
192 ;
193 000170 120014 TSCHAR: CMPB R0,(R4) ; CHECK CHAR IN COMMAND STRING
194 000172 001347 BNE NXTRAN ; IF NO MATCH, TRY ANOTHER TRANSITION
195 ;
196 ; GOBBLE A CHARACTER AND DO THE TRANSITION
197 ;
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 3-2
MAIN ROUTINE BODY
198 000174 005703 DOCHAR: TST R3 ; CHECK FOR END OF STRING
199 000176 003745 BLE NXTRAN ; IF YES, DON'T TRY THIS
200 000200 012767 000001 000002' MOV #1,.PSTCN ; STRING COUNT = 1
201 000206 112467 000006' MOVB (R4)+,.PCHAR ; SAVE CHAR FOR ACTION ROUTINE
202 000212 005303 DEC R3 ; COUNT IT
203 ;
204 ; DO THE STATE TRANSITION
205 ;
206 000214 DOLAMB:
207 000214 DOTRAN: PUSH R5 ; SAVE STATE TABLE ADDRESS
208 000216 112500 MOVB (R5)+,R0 ; GET FLAGS BYTE
209 000220 006000 ROR R0 ; CHECK EXTENSION BIT
210 000222 103001 BCC 50$
211 000224 005725 TST (R5)+ ; SKIP EXTENSION WORD
212 000226 006000 50$: ROR R0 ; CHECK ACTION BIT
213 000230 103007 BCC 70$
214 000232 PUSH R0 ; SAVE R0 FOR USER
215 000234 CALL @(R5)+ ; CALL ACTION ROUTINE
216 000236 000403 BR 60$ ; NORMAL RETURN FROM ACTION ROUTINE
217 ; ACTION ROUTINE RETURNS AT CALL+4
218 000240 POP <R0,R5> ; TO REJECT THE TRANSITION
219 000244 000722 BR NXTRAN ; TRY NEXT TRANSITION IN STATE
220
221 000246 60$: POP R0 ; RESTORE R0
222 000250 005726 70$: TST (SP)+ ; CLEAN THE STACK
223 000252 006000 ROR R0 ; CHECK FOR BIT MASK
224 000254 006000 ROR R0 ; REPRESENTED BY TWO BITS, BOTH ON
225 000256 103001 BCC 80$ ; BRANCH IF NONE
226 000260 052535 BIS (R5)+,@(R5)+ ; SET MASK IN DESIGNATED WORD
227 000262 006000 80$: ROR R0 ; CHECK EXPLICIT TRANSITION BIT
228 000264 103252 BCC TSTAT
229 000266 012505 MOV (R5)+,R5 ; POINT TO NEXT STATE
230 000270 001250 90$: BNE TSTAT ; PROCESS NEXT STATE
231 000272 000257 CCC ; STATE NUMBER OF ZERO MEANS STOP
232
233 000274 EXIT: POP <R2,R5,R0> ; RESTORE ALL THE REGISTERS
234 000302 016701 000000' MOV .PFLAG,R1 ; RESTORE FLAG WORD
235 000306 RETURN
236
237 .DSABL LSB
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 4
COMPLEX TYPE ROUTINES
239 .SBTTL COMPLEX TYPE ROUTINES
240
241 .ENABL LSB
242
243 ;
244 ; SUB EXPRESSION TYPE - CALL ONESELF RECURSIVELY
245 ;
246 000310 016701 000000' DOSUBR: MOV .PFLAG,R1 ; SET SPACE FLUSH FLAG
247 000314 011602 MOV (SP),R2 ; SET KEYWORD TABLE POINTER
248 000316 PUSH <R3,R4> ; SAVE STRING POINTERS FOR UNWIND
249 000322 010500 MOV R5,R0 ; SAVE STATE TABLE POINTER
250 000324 016505 000001 MOV 1(R5),R5 ; GET STARTING STATE
251 000330 CALL .TPARS ; AND TRY TO PARSE SUBEXPRESSION
252 000334 006101 ROL R1 ; SAVE THE C BIT
253 000336 010005 MOV R0,R5 ; RESTORE STATE POINTER
254 000340 012667 000004' MOV (SP)+,.PSTPT ; OLD R4 = START OF STRING
255 000344 160316 SUB R3,(SP) ; OLD R3 - NEW R3 = LENGTH
256 000346 012667 000002' MOV (SP)+,.PSTCN ; SAVE IT
257 000352 006001 ROR R1 ; RESTORE C BIT
258 000354 103317 10$: BCC DOTRAN ; TAKE THE TRANSITION IF SUCCESSFUL
259 000356 000655 BR NXTRAN ; ELSE TRY SOMETHING ELSE
260 ;
261 ; MATCH ANY ALPHANUMERIC STRING
262 ;
263 000360 005000 DORD50: CLR R0 ; SET RAD-50 FLAG
264 000362 DOSTRG: CALL GETSTR ; JUST DRAG IN THE STRING
265 000366 000403 BR 20$
266 ;
267 ; MATCH ANY NON-EMPTY STRING OF SPACES OF TABS
268 ;
269 000370 DOBLNK: CALL GETSP ; LOOK FOR SPACES
270 000374 005702 TST R2 ; CHECK NUMBER FOUND
271 000376 001645 20$: BEQ NXTRAN ; NOTHING - TRY SOMETHING ELSE
272 000400 000705 BR DOTRAN ; YES - DO IT
273 ;
274 ; MATCH SPECIFIED KEYWORD
275 ;
276 000402 042700 177700 DOKEY: BIC #^C77,R0 ; GET KEYWORD INDEX, SET FOR ALPHA-NUMERIC
277 000406 CALL GETSTR ; GET ALPHA-NUMERIC STRING
278 000412 001637 BEQ NXTRAN ; DON'T TRY TO MATCH NULL STRING
279 000414 006300 ASL R0 ; CONVERT TO OFFSET
280 000416 061600 ADD (SP),R0 ; INDEX INTO KEYWORD TABLE
281 000420 011000 MOV (R0),R0 ; FOLLOW THE STRING POINTER
282 000422 016701 000002' MOV .PSTCN,R1 ; GET STRING DESCRIPTOR
283 000426 016702 000004' MOV .PSTPT,R2
284
285 000432 122022 30$: CMPB (R0)+,(R2)+ ; COMPARE TO KEYWORD
286 000434 001226 BNE NXTRAN ; OUT ON MISMATCH
287 000436 SOB R1,30$ ; COUNT CHARS AND LOOP
288 000442 121027 000377 CMPB (R0),#377 ; CHECK FOR KEYWORD TERMINATOR
289 000446 001221 BNE NXTRAN ; STRING WAS SUBSET - NO
290 000450 000661 BR DOTRAN ; MATCH
291 ;
292 ; MATCH ANY NUMBER
293 ;
294 000452 005001 DODNMB: CLR R1 ; SET DECIMAL MODE
295 000454 005400 DONUMB: NEG R0 ; SET UP FOR NUMERIC STRING
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 4-1
COMPLEX TYPE ROUTINES
296 000456 CALL GETSTR ; GET A STRING
297 000462 001613 BEQ NXTRAN ; COME ON, AT LEAST ONE DIGIT
298 000464 005701 TST R1 ; CHECK MODE
299 000466 001411 BEQ 40$ ; DECIMAL - DON'T LOOK FOR TRAILING DOT
300 000470 005703 TST R3 ; SEE IF WE'RE AT END OF STRING
301 000472 003407 BLE 40$ ; YES
302 000474 121427 000056 CMPB (R4),#'. ; CHECK FOR TRAILING DECIMAL
303 000500 001004 BNE 40$ ; NO
304 000502 005204 INC R4 ; YES - INCLUDE IN NUMBER STRING
305 000504 005303 DEC R3
306 000506 005267 000002' INC .PSTCN ; BUMP STRING COUNT
307 000512 40$: PUSH <R3,R4,R5> ; SAVE REGISTERS
308 000520 016705 000004' MOV .PSTPT,R5 ; GET STRING POINTER
309 000524 016704 000002' MOV .PSTCN,R4 ; AND STRING COUNT
310 000530 012703 000010' MOV #.PNUMH,R3 ; POINT TO DOUBLE WORD FOR NUMBER
311 000534 005701 TST R1 ; CHECK IF OCTAL OR DECIMAL
312 000536 001003 BNE 50$ ; OCTAL
313 000540 CALL .DD2CT ; DECIMAL
314 000544 000402 BR 60$
315 000546 50$: CALL .OD2CT ; DO OCTAL/DECIMAL CONVERT
316 000552 60$: POP <R5,R4,R3> ; RESTORE REGISTERS
317 000560 000675 BR 10$
318
319 .DSABL LSB
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 5
GET STRING ROUTINE
321 .SBTTL GET STRING ROUTINE
322
323 ;
324 ; THIS ROUTINE POINTS THE STRING DESCRIPTOR AT THE ALPHA-NUMERIC
325 ; STRING AT THE CURRENT POSITION IN THE COMMAND LINE.
326 ;
327 ; INPUTS: R0 = MODE FLAG
328 ; - IS NUMERIC ONLY
329 ; + IS ALPHANUMERIC
330 ; 0 IS RAD-50 SET
331 ; .PSTCN = 0
332 ; .PSTPT = START OF STRING = R4
333 ;
334
335 000562 005703 GETSTR: TST R3 ; CHECK FOR END OF STRING
336 000564 003425 BLE 30$ ; IF YES, DON'T TRY THIS
337
338 000566 10$: CALL GETDIG ; TRY A DIGIT
339 000572 103015 BCC 20$ ; OK
340 000574 005700 TST R0 ; CHECK MODE
341 000576 002420 BLT 30$ ; BRANCH IF NUMERIC ONLY
342 000600 CALL GETALP ; CHECK FOR AN ALPHABETIC
343 000604 103010 BCC 20$ ; OK
344 000606 005700 TST R0 ; SEE IF RAD-50 MODE
345 000610 001013 BNE 30$ ; NO
346 000612 121427 000056 CMPB (R4),#'. ; CHECK FOR "."
347 000616 001403 BEQ 20$
348 000620 121427 000044 CMPB (R4),#'$ ; CHECK FOR "$"
349 000624 001005 BNE 30$
350 000626 005267 000002' 20$: INC .PSTCN ; GOOD CHAR - BUMP COUNT
351 000632 005204 INC R4 ; GOBBLE THE CHAR
352 000634 SOB R3,10$ ; COUNT IT AND LOOP
353 000640 005767 000002' 30$: TST .PSTCN ; IF NONE FOUND, RETURN WITH Z SET
354 000644 RETURN ; END OF LINE OR NON-ALPHA NUMERIC
355
356
357 ;
358 ; THIS ROUTINE CHECKS FOR A SINGLE ALPHABETIC.
359 ; RETURNS WITH C SET IF NOT.
360 ;
361 000646 122714 000132 GETALP: CMPB #'Z,(R4) ; CHECK IF LESS THAN "Z"
362 000652 103402 BLO 40$ ; NO - CARRY IS SET
363 000654 121427 000101 CMPB (R4),#'A ; CHECK AGAINST "A" (SETS CARRY RIGHT!)
364 000660 40$: RETURN ; (DO NOT MESS WITH THE ABOVE COMPARES.)
365 ;
366 ; THIS ROUTINE TESTS FOR A SINGLE DIGIT.
367 ; RETURNS WITH C SET IF NOT.
368 ;
369 000662 122714 000071 GETDIG: CMPB #'9,(R4) ; CHECK IF LESS THAN '9"
370 000666 103402 BLO 50$ ; NO - CARRY IS SET
371 000670 121427 004460 CMPB (R4),#"0 ; TEST AGAINST "0" - SETS CARRY RIGHT
372 000674 50$: RETURN ; (SAME WARNING ABOUT THESE TESTS.)
373
374 ;
375 ; THIS ROUTINE FINDS AND PASSES OVER BLANKS AND TABS AT THE CURRENT
376 ; POSITION IN THE COMMAND LINE.
377 ;
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 5-1
GET STRING ROUTINE
378 000676 005002 GETSP: CLR R2 ; ZERO CHAR COUNT
379 000700 005703 TST R3 ; CHECK FOR END OF STRING
380 000702 003412 BLE 80$ ; IF YES, DON'T TRY THIS
381 000704 121427 000040 60$: CMPB (R4),#SPA ; TEST FOR SPACE IN COMMAND LINE
382 000710 001403 BEQ 70$
383 000712 121427 000011 CMPB (R4),#TAB ; TEST FOR TAB
384 000716 001004 BNE 80$
385 000720 005202 70$: INC R2 ; BLANK OR TAB FOUND - BUMP COUNT
386 000722 005204 INC R4 ; BUMP STRING POINTER
387 000724 SOB R3,60$ ; COUNT CHARS AND LOOP
388 000730 80$: RETURN
389
390
391
392 000001 .END
.TPARS - TABLE DRIVEN FINITE ST MACRO M1108 05-DEC-77 23:52 PAGE 5-2
SYMBOL TABLE
AM = 000033 DOKEY 000402R GETALP 000646R SYNERR 000146R .PCHAR 000006RG 002
CR = 000015 DOLAMB 000214R GETDIG 000662R TAB = 000011 .PFLAG 000000RG 002
DOALPH 000152R DONUMB 000454R GETSP 000676R TSCHAR 000170R .PNUMB 000012RG 002
DOBLNK 000370R DORD50 000360R GETSTR 000562R TSTAT 000012R .PNUMH 000010RG 002
DOCHAR 000174R DOSTRG 000362R MAXTYP= 000024 $$ = 000067 .PSTCN 000002RG 002
DODIGT 000160R DOSUBR 000310R NXTRAN 000112R .DD2CT= ****** GX .PSTPT 000004RG 002
DODNMB 000452R DOTRAN 000214R SPA = 000040 .OD2CT= ****** GX .TPARS 000000RG
DOENDS 000106R EXIT 000274R
. ABS. 000000 000
000732 001
IMPURE 000014 002
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 597 WORDS ( 3 PAGES)
DYNAMIC MEMORY: 3104 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:14
[61,10]TPARS,[61,20]TPARS/-SP=[61,30]TPARS