-
Notifications
You must be signed in to change notification settings - Fork 0
/
k11cm1.mac
286 lines (217 loc) · 6.28 KB
/
k11cm1.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
.title k11cm1 overlay for some command dispatching
.ident /2.23/
; 16-Oct-84 15:38:31 Brian Nelson
;
; Creation: 16-Oct-84 15:38:44
;
;
; Copyright (C) 1983 1984 Change Software, Inc.
;
;
; This software is furnished under a license and may
; be used and copied only in accordance with the
; terms of such license and with the inclusion of
; the above copyright notice. This software or any
; other copies thereof may not be provided or other-
; wise made available to any other person. No title
; to and ownership of the software is hereby trans-
; ferred.
;
; The information in this software is subject to
; change without notice and should not be construed
; as a commitment by the author.
;
; 12-Sep-86 10:39:27 BDN Convert for I/D space
.if ndf, K11INC
.ift
.include /IN:K11MAC.MAC/
.include /IN:K11CDF.MAC/
.endc
.enabl gbl
.psect
.psect $code
.sbttl the set command
.enabl lsb
; Note: For edit /41/ the call to GETPRV for MicroRSX has been
; placed in ASSDEV, which is ONLY called from SET LINE (SET$LI)
c$set:: $name <SET>
call loaset
calls getcm0 ,<argbuf,r0>
mov r0 ,r2
bmi 110$
call loaset
calls getcm1 ,<argbuf,r0,r2>
tst r0
bmi 110$
jsr pc ,@r1
tst r0
beq 100$
message <Invalid value for SET>,cr
inc status
100$: return
110$: message <Unknown/invalid Set command>,cr
inc status
return
.dsabl lsb
.sbttl the connect command
c$conn::$name <CON>
tst con$dsp ; /44/ SET [RSX] [CONNECT] done?
bne 1$ ; /44/ Yes
mov #doconn ,con$dsp ; /44/ No, insert default routine
1$: tstb @argbuf ; anything in the arg buffer?
beq 5$ ; no
call set$li ; set the line then
5$: tst conesc ; an escape character set ?
bne 10$ ; yes
movb #con$esc,conesc ; no, set the default in
10$: copyz #ttdial ,#ttname ; insure correct name
clr remote ; insure remote flag set
mov recdlm ,-(sp) ; /56/ Save RMS record delimiter
mov #12 ,recdlm ; /56/ Change to write on line feeds
call @con$dsp ; /44/ Call the user's choice
mov (sp)+ ,recdlm ; /56/ Restore put$ trigger char
message ; a cr/lf
return ; back to command parser
GLOBAL <argbuf,conesc,doconn,remote,ttdial,ttname> ; /44/
GLOBAL <con$es,con$ds,set$li> ; /44/
GLOBAL <recdlm> ; /56/
.sbttl the local directory and type commands
.enabl lsb
c$dir:: $name <DIR>
tstb defdir
beq 10$
message <Current default is >
print #defdir
message
10$: calls dodir ,<argbuf,#0> ; get the passed filespec for dir
tst r0 ; do the directoty. did it work ?
beq 100$ ; yes
direrr r0 ; no, print the error
100$: return ; bye
.dsabl lsb
c$who:: calls systat ,<#0>
return
c$tran::calls transf ,<argbuf,#0>
return
.sbttl the take command
.enabl lsb
c$take::$name <TAKE>
sub #filsiz ,sp ; save current def dir
mov sp ,r1 ; point to it
copyz #defdir ,r1 ; done
tst cmdlun ; indirect file already open ?
beq 10$ ; no
tst sy.ini ; during init from INI file?
bne 5$ ; yes, don't bother with message
tst infomsg ; /41/ How verbose are we today?
beq 5$ ; /41/ Not very
message <Previous TAKE file closed>,cr
5$: clr sy.ini ; not in an init file anymore
calls close ,<#lun.ta> ; yes, please close it now
clr cmdlun ; assume the next open will fail?
10$: copyz #200$ ,#defdir ; stuff take defaults in now
calls open ,<argbuf,#lun.ta,#text>
tst r0 ; did the open for command file work?
bne 90$ ; no, print error and exit
20$: mov #lun.ta ,cmdlun ; yes, stuff the unit number in
br 100$ ; bye
90$: direrr r0 ; print a error message and exit
clr cmdlun ; force input from KB:
100$: mov sp ,r1 ; restore old default directory
copyz r1 ,#defdir ; simple
add #filsiz ,sp ; copy def dir save area back
return ; bye
.save
.psect $PDATA ,D
200$: .asciz /SY:*.CMD/
.even
.restore
.dsabl lsb
global <infomsg>
.sbttl the SYSTEM command
.enabl lsb
c$sys:: $name <SYS>
tstb @argbuf ; need something in ARGBUF
bne 10$ ; oops
message <The SYSTEM command requires a command to execute>,cr
return
10$: strlen argbuf ; get the current length so we
add argbuf ,r0 ; can stuff a carriage return
movb #cr ,(r0)+ ; and a null in
clrb @r0 ; all set now
mov argbuf ,200$+2
mov #200$ ,r5 ; call the PK driver
call runjob ; simple
tst r0 ; did it work ?
beq 100$ ; yes
message <Error from spawning command >
decout r0
message
100$: message
return
; ierr = runjob(buffer,mode,10,timout)
;
; All parameters for RSTS are used so we can use the
; generalized PK code used also in MINITAB (C) and TED.
; For RSX11M/M+, only the first argument is needed.
.save
.psect $PDATA ,D
200$: .word 4,0,220$,230$,240$ ; parameter list
220$: .word 100305 ; internal mode for running on the PK
230$: .word 10. ; first free logical unit number
240$: .word 10. ; ten minutes and i kill the PK's job
.restore
.dsabl lsb
global <argbuf ,runjob>
c$spac::$name <SPA>
sub #120 ,sp ; allocate space for a buffer
mov sp ,r1 ; point to it
calls dskuse ,<r1> ; get the usage string
print r1 ; print it
message ; a crlf
add #120 ,sp ; pop the local buffer
return ; and exit
.sbttl the local type command
.enabl lsb
.save
.psect buffer ,rw,d,lcl,rel,con
buffer: .blkb 1000
.restore
c$type::$name <TYP>
mov #buffer ,r4 ; and point to it of course
calls fparse ,<argbuf,r4> ; parse the filename please
tst r0 ; did the $parse work ok ?
bne 90$ ; no
print r4 ; yes, print the expanded name out
message
5$: clr r2 ; assume file not open
calls open ,<argbuf,#lun.in,#text>; try to open passed filename
tst r0 ; but did the open work out ?
bne 90$ ; no
com r2 ; flag it as being open please
10$: tst cccnt ; control C typed ?
bne 90$ ; yes, abort this
calls getrec ,<r4,#lun.in> ; get the next record
tst r0 ; did it work ?
bne 90$ ; no
20$: tst r1 ; null record (ie, cr/lf only) ?
beq 30$ ; yep
print r4,r1 ; dump the record
30$: message ; a cr/lf
br 10$ ; next record please
90$: tst r0 ; forced exit ?
beq 95$ ; yes
cmp r0 ,#ER$EOF ; end of file ?
beq 95$ ; yes, its ok
direrr r0 ; no, print the error out
95$: tst r2 ; is the type file open ?
beq 100$ ; no
96$: calls close ,<#lun.in> ; yes, please close it up now
100$: return
global <argbuf ,cccnt ,defdir ,ER$EOF ,lun.in>
.dsabl lsb
.sbttl print command
c$prin::calls qspool ,<argbuf,#lun.in>
direrr r0
return
.end