disk8: Initial commit
[pdp8.git] / sw / adventure / PSPEAK.RA
1 SECT PSPEAK
2 / SUBROUTINE PSPEAK(MSG,SKIP)
3 / C
4 / C FIND THE SKIP+1ST MESSAGE FOR OBJECT MSG AND PRINT IT.
5 / C MSG SHOULD BE THE INDEX OF
6 / C THE OBJECT. (INVEN+N+1 MESSAGE IS PROP=N MESSAGE).
7 / C
8 / IMPLICIT INTEGER (A-Z)
9 / COMMON /TXTCOM/ RTEXT,LINES,ASCVAR
10 / COMMON /PTXCOM/ PTEXT
11 / DIMENSION RTEXT(205),LINES(36),PTEXT(100)
12
13 EXTERN IO
14 EXTERN SPEAK
15 JA #ST
16 #XR, ORG .+10
17 TEXT +PSPEAK+
18 #RET, SETX #XR
19 SETB #BASE
20 JA .+3
21 #BASE, ORG .+6
22 MSG, ORG .+3
23 SKIP, ORG .+3
24 ONE, F 1.0
25 #DOTMP, ORG .+3
26 OLDLOC, ORG .+3
27 ORG #BASE+30
28 FNOP
29 JA #RET
30 FNOP
31 #GOBAK, 0;0
32 I, ORG .+0003
33 M, ORG .+0003
34 #LBL=.
35 COMMON PTXCOM
36 PTEXT, ORG .+0454
37 COMMON TXTCOM
38 RTEXT, ORG .+1147
39 LINES, ORG .+0044
40 ASCVAR, ORG .+0003
41 TXTLOC, ORG .+0003
42 DATA, ORG .+0352
43 ORG #LBL
44 #RTN, BASE #BASE
45 JA #GOBAK
46 #ST, STARTD
47 0210
48 FSTA #GOBAK,0
49 0200
50 SETX #XR
51 SETB #BASE
52 LDX 0,1
53 FSTA #BASE
54 FLDA% #BASE,1+
55 FSTA MSG
56 FLDA% #BASE,1+
57 FSTA SKIP
58 STARTF
59 / M=PTEXT(MSG)
60 FLDA% MSG
61 ATX 7
62 FLDA PTEXT-0003,7
63 FSTA M
64 / IF(SKIP.LT.0)GOTO 9
65 FLDA% SKIP
66 JLT #9
67 / OLDLOC=MSG
68 FLDA% MSG
69 FSTA OLDLOC
70 / DO 3 I=1,SKIP+1
71 FLDA ONE
72 FSTA I
73 FLDA% SKIP
74 FADD ONE
75 FSTA #DOTMP
76
77 #G0001,
78 / 1 READ(2'M)LOC,LINES
79 #1, JSR IO
80 JA .+0004
81 JA M
82 / M = ASCVAR
83 FLDA M
84 FADD ONE
85 FSTA M
86 / IF(LOC.EQ.OLDLOC) GO TO 1
87 FLDA TXTLOC
88 FSUB OLDLOC
89 JEQ #1
90 / OLDLOC=LOC
91 FLDA TXTLOC
92 FSTA OLDLOC
93 / 3 CONTINUE
94 #3, FLDA I
95 FADD ONE
96 FSTA I
97 FSUB #DOTMP
98 JLE #G0001
99 / M=M-1
100 FLDA M
101 FSUB ONE
102 FSTA M
103 / CALL SPEAK(M)
104 #9, JSR SPEAK
105 / RETURN
106 / END
107 JA #RTN
108 JA M
109 END