-
Notifications
You must be signed in to change notification settings - Fork 3
/
zork.3
383 lines (344 loc) · 5.81 KB
/
zork.3
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
TITLE TRIVIA startup
.MLLIT==1
TTYCHN==1
SAVCHN==2
MUDCHN==3
DSKCHN==4
O=0
A=1
B=2
C=3
TIME=3
NOW=4
XUNAME=5
P=17
VBPTR: 440700,,A
VSBPTR: 140600,,B
DSKDEV: SIXBIT /DSK/
MSGDIR: SIXBIT /_MSGS_/
BADNAM: SIXBIT /ABADBO/
BADDIR: SIXBIT /VANISH/
SXUNAM: BLOCK 2
START: MOVE P,[-30,,PDL-1]
.OPEN TTYCHN,[SIXBIT / !TTY/]
.LOSE 1000
.SUSET [.RXUNAME,,XUNAME]
HLRZ A,XUNAME
CAIN A,777777
JRST LOGIN
.CALL DEATH
JRST CKUSER
.CALL [SETZ ; GET FILE LENGTH IN A
SIXBIT /FILLEN/
MOVEI DSKCHN
SETZM A]
JRST FAKMSG
CAIN A,
JRST FAKMSG
MOVE B,BUFPTR
.IOT DSKCHN,B
.CLOSE DSKCHN,
MOVE B,[440700,,BUF]
MSGDTH: PUSHJ P,OUTMSG
MSGEND: PUSHJ P,WINNER
JRST WIN
.BREAK 16,140000
FAKMSG: MOVE B,[440700,,MSG]
.CLOSE DSKCHN,
JRST MSGDTH
CKUSER: PUSHJ P,WINNER
JRST WIN
LDB A,[063600,,XUNAME]
CAMN A,[SIXBIT / GUEST/]
JRST CKTIME
.CALL DIROPN ; REAL PERSON?
JRST CKTIME ; NOPE
.CALL MSGOPN ; REALLY A REAL PERSON?
JRST LOSNAM
.CLOSE DSKCHN,
CKNUM: PUSHJ P,ZKCNT
JRST TOOMNY
WIN: .CALL SAVOPN
.VALUE [ASCIZ /: No SAVE file?
/]
.IOT SAVCHN,[-1,,A]
MOVSI B,SIXBIT / MUD/
ILDB C,VBPTR
SUBI C,40
DPB C,VSBPTR
ILDB C,VBPTR
SUBI C,40
IDPB C,VSBPTR
.ACCES SAVCHN,[0]
.CALL MUDOPN
.VALUE [ASCIZ /: No TS MUDDLE ?
/]
MOVSI 17,STUFF
BLT 17,17
JRST 1
LOSNAM: MOVE B,[440700,,NAMMSG]
PUSHJ P,OUTMSG
MOVE B,[440600,,XUNAME]
MOVE C,[440700,,SXUNAM]
SIXLOP: ILDB A,B
JUMPE A,SIXTOO
ADDI A,40
IDPB A,C
JRST SIXLOP
SIXTOO: MOVE B,[440700,,SXUNAM]
PUSHJ P,OUTMSG
MOVE B,[440700,,NAMEND]
PUSHJ P,OUTMSG
.BREAK 16,160000
LOGIN: MOVE B,[440700,,LOGMSG]
PUSHJ P,OUTMSG
.BREAK 16,160000
OFFHOR: MOVE B,[440700,,OFFMSG]
PUSHJ P,OUTMSG
.BREAK 16,160000
TOOMNY: MOVE B,[440700,,TOOMSG]
PUSHJ P,OUTMSG
.BREAK 16,160000
CKTIME: .RYEAR A,
LDB A,[320300,,A] ; IS IT A WEEKEND?
JUMPE A,CURFCK
CAIN A,6
JRST CURFCK
.RTIME A,
LDB A,[301400,,A] ; IS IT OFFICE HOURS?
CAIGE A,'20
CAIGE A,'09
JRST CURFCK
.RDATE A,
.CALL HOLOPN ; IS IT A HOLIDAY?
JRST FLUSH
CURFCK: .CALL CURFEW
JRST CKNUM
.CLOSE DSKCHN,
MOVE B,[440700,,CURMSG]
PUSHJ P,OUTMSG
.BREAK 16,160000
FLUSH: .CALL BADBOY
JRST NEWBAD
.CALL RFDATE
JFCL
.CALL RQDATE
JFCL
.CALL SFDATE
JFCL
.CLOSE DSKCHN,
HLRZ A,TIME ; DID THE TURKEY TRY <1/2 HR AGO?
HLRZ B,NOW
CAME A,B
JRST OFFHOR
SUB NOW,TIME
CAIGE NOW,2400.
JRST LOGOUT
JRST OFFHOR
NEWBAD: .CALL MAKBAD
.LOSE 1000
.CLOSE DSKCHN,
JRST OFFHOR
LOGOUT: .VALUE [ASCIZ /:You don't believe me, eh? That makes me MAD!!!
0U
/]
.BREAK 16,160000
ZKCNT: MOVEI B,40
MOVEI O,3
ZKLOP: SOJL B,[AOS (P)
POPJ P,]
SKIPN @MSUSER
JRST ZKLOP
MOVE A,@MSRED2
CAME A,[SIXBIT /ZORK/]
JRST ZKLOP
SOJG O,ZKLOP
POPJ P,
SQUOZE 0,MSUSER
MSUSER: 0
SQUOZE 0,MSRED2
MSRED2: 0
INIT: MOVE B,[-200,,200]
MOVEI A,0
.CALL [SETZ
SIXBIT /CORBLK/
MOVEI %CBRED
MOVEI %JSELF
B
MOVEI %JSABS
SETZ A]
.LOSE 1000
MOVE A,MSUSER-1
.EVAL A,
.LOSE 1000
ADD A,[B,,400000]
MOVEM A,MSUSER
MOVE A,MSRED2-1
.EVAL A,
.LOSE 1000
ADD A,[B,,400000]
MOVEM A,MSRED2
.VALUE [ASCIZ /K
:PDUMP SYS2;TS ZORK
:KILL
/]
OUTMSG: PUSH P,A ; GIVEN BYTE POINTER, PRINT FROB OUT
PUSH P,C
PUSH P,B
MOVEI C,
OUTLOP: ILDB A,B ; LIKES BYTE POINTER TO FROB IN B
CAIE A,0
CAIN A,3
JRST OUTEND
AOJA C,OUTLOP
OUTEND: POP P,B ; GET BYTE POINTER IN B, COUNT IS IN C
.CALL [SETZ
SIXBIT /SIOT/
MOVEI TTYCHN
B
SETZ C]
.LOSE 1000
POP P,C
POP P,A
POPJ P,
WINNER: CAME XUNAME,[SIXBIT /TAA/]
CAMN XUNAME,[SIXBIT /MARC/]
POPJ P,
CAME XUNAME,[SIXBIT /PDL/]
CAMN XUNAME,[SIXBIT /SEC/]
POPJ P,
CAME XUNAME,[SIXBIT /BKD/]
CAMN XUNAME,[SIXBIT /ELBOW/]
POPJ P,
AOS (P)
POPJ P,
DEATH: SETZ
SIXBIT /OPEN/
MOVSI .BII
MOVEI DSKCHN
DSKDEV
[SIXBIT /ZORK/]
[SIXBIT /DEATH/]
SETZ MSGDIR
DIROPN: SETZ
SIXBIT /OPEN/
MOVSI .BII
MOVEI DSKCHN
DSKDEV
[SIXBIT /.FILE./]
[SIXBIT /(DIR)/]
SETZ XUNAME
MSGOPN: SETZ
SIXBIT /OPEN/
MOVSI .BII
MOVEI DSKCHN
DSKDEV
MSGDIR
XUNAME
SETZ XUNAME
MUDOPN: SETZ
SIXBIT /OPEN/
MOVSI 4
MOVEI MUDCHN
DSKDEV
[SIXBIT /TS/]
B
SETZ [SIXBIT /SYS1/]
SAVOPN: SETZ
SIXBIT /OPEN/
MOVSI 6
MOVEI SAVCHN
DSKDEV
[SIXBIT /MADADV/]
[SIXBIT /SAVE/]
SETZ [SIXBIT /MADMAN/]
HOLOPN: SETZ
SIXBIT /OPEN/
MOVSI .BII
MOVEI DSKCHN
DSKDEV
[SIXBIT /HLIDAY/]
A
SETZ [SIXBIT /COMBAT/]
CURFEW: SETZ
SIXBIT /OPEN/
MOVSI .BII
MOVEI DSKCHN
DSKDEV
[SIXBIT /TRIVIA/]
[SIXBIT /CURFEW/]
SETZ MSGDIR
BADBOY: SETZ
SIXBIT /OPEN/
MOVSI .BII
MOVEI DSKCHN
DSKDEV
BADNAM
XUNAME
SETZ BADDIR
RFDATE: SETZ
SIXBIT /RFDATE/
MOVEI DSKCHN
SETZM TIME
RQDATE: SETZ
SIXBIT /RQDATE/
SETZM NOW
SFDATE: SETZ
SIXBIT /SFDATE/
MOVEI DSKCHN
SETZ NOW
MAKBAD: SETZ
SIXBIT /OPEN/
MOVSI 1
MOVEI DSKCHN
DSKDEV
BADNAM
XUNAME
SETZ BADDIR
STUFF: OFFSET -.
2
.CALL LOAD
.VALUE
.IOT MUDCHN,A
.CLOSE MUDCHN,
ADDI A,1
JRST @A
LOAD: SETZ
SIXBIT /LOAD/
1000,,-1
SETZI MUDCHN
OFFSET 0
MSG: ASCIZ /
ZORK is down for repairs. Sigh.
/
OFFMSG: ASCIZ /
ZORK is not available during office hours (9 AM to 8 PM, Eastern time.)
/
TOOMSG: ASCIZ /
There appears before you a threatening figure clad all over
in heavy black armor. His legs seem like the massive trunk
of the oak tree. His broad shoulders and helmeted head loom
high over your own puny frame and you realize that his powerful
arms could easily crush the very life from your body. There
hangs from his belt a veritable arsenal of deadly weapons:
sword, mace, ball and chain, dagger, lance, and trident.
He speaks with a commanding voice:
"YOU SHALL NOT PASS "
As he grabs you by the neck all grows dim about you./
NAMMSG: ASCIZ /
Losers with the name /
NAMEND: ASCIZ / cannot play ZORK!
/
LOGMSG: ASCIZ /
Losers who are not logged in cannot play ZORK!
/
CURMSG: ASCIZ /
The system is VERY loaded. Please try again later.
/
BUF: BLOCK 200
BUFPTR: BUF-.,,BUF
PDL: BLOCK 30
END START