annotate level1/cmds/help.asm @ 1020:c1a5613ffe7b

changes
author boisy
date Thu, 06 Mar 2003 01:41:03 +0000
parents 5c80e10a5d03
children 89684462df13
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
1 ********************************************************************
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
2 * Help - Show help
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
3 *
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
4 * $Id$
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
5 *
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
8 * 6 Rewrote in assembler for size BGP 03/01/21
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
9
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
10 nam Help
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
11 ttl Show help
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
12
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
13 ifp1
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
14 use defsfile
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
15 endc
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
16
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
17 COLWIDTH set 10
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
18
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
19 tylg set Prgrm+Objct
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
20 atrv set ReEnt+rev
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
21 rev set $01
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
22 edition set 6
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
23
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
24 mod eom,name,tylg,atrv,start,size
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
25
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
26 name fcs /Help/
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
27 fcb edition
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
28
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
29 org 0
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
30 exitvec rmb 2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
31 ncols rmb 1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
32 colcopy rmb 1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
33 bufptr rmb 2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
34 path rmb 1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
35 same rmb 1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
36 prmptr rmb 2
946
5c80e10a5d03 renamed variable that was clashing with one in systype
boisy
parents: 943
diff changeset
37 prmend rmb 2
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
38 length rmb 2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
39 colbuff rmb 128
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
40 userbuf rmb 128
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
41 parbuff rmb 256
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
42 filbuff rmb 256
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
43 stack rmb 350
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
44 size equ .
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
45
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
46 * Ask user for subjects
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
47 askuser leax askusr2,pcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
48 stx <exitvec
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
49 leax prompt1,pcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
50 lda #1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
51 ldy #128
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
52 os9 I$WritLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
53 askusr2 leax prompt2,pcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
54 lda #1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
55 ldy #prompt2l
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
56 os9 I$Write
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
57 clra
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
58 ldy #127
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
59 leax userbuf,u
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
60 os9 I$ReadLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
61 lbcc askusr3
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
62 cmpb #E$EOF
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
63 lbne exit
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
64 lbra exitok
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
65
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
66 * Show topics (if user enters nothing at prompt)
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
67 showtopics
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
68 lda #1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
69 leax >avail,pcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
70 ldy #128
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
71 os9 I$WritLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
72 lbsr seek0 rewind the file
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
73 resetcl lda <ncols
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
74 sta <colcopy
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
75 leax colbuff,u
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
76 stx <bufptr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
77 readlp lbsr readlin
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
78 bcc readlp2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
79 lbsr printcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
80 bra askusr2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
81 readlp2 leax filbuff,u
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
82 lda ,x+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
83 cmpa #'@
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
84 bne readlp
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
85 ldy <bufptr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
86 strcpy clra
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
87 clrb
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
88 pshs d
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
89 strc0 lda ,x+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
90 cmpa #C$SPAC
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
91 ble strc1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
92 sta ,y+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
93 ldd ,s
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
94 addd #$0001
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
95 std ,s
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
96 bra strc0 do again
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
97 strc1 puls d
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
98 dec <colcopy
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
99 beq doeol
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
100 cmpb #COLWIDTH
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
101 bge onesp
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
102 pshs b
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
103 ldb #COLWIDTH
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
104 subb ,s+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
105 fcb $8C
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
106 onesp ldb #1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
107 lda #C$SPAC
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
108 spacelp sta ,y+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
109 decb
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
110 bne spacelp
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
111 sty <bufptr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
112 bra readlp
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
113 doeol sty <bufptr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
114 lda #C$CR
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
115 sta ,y
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
116 leax colbuff,u
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
117 lda #1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
118 ldy #128
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
119 os9 I$WritLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
120 bra resetcl
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
121
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
122 askusr3 lda ,x
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
123 cmpa #C$CR
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
124 beq showtopics
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
125 lbsr seek0 rewind the file
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
126 bra entrya
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
127
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
128 start pshs d,x,y
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
129 lda #8
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
130 sta <ncols assume 8 columns
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
131 lda #1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
132 ldb #SS.ScSiz
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
133 os9 I$GetStt
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
134 bcs start2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
135 cmpx #9
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
136 ble start1 A = 1 here
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
137 tfr x,d
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
138 clra
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
139 * Divide screen X by COLWIDTH to determine number of columns
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
140 Div10 subb #COLWIDTH
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
141 bcs start1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
142 inca
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
143 bra Div10
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
144 start1 sta <ncols
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
145
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
146 start2 leax exit,pcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
147 stx <exitvec
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
148 puls d,x,y
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
149 tfr d,y length of parameters
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
150 bsr open
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
151 bcs exit
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
152 cmpy #$0001 no parameters?
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
153 lbeq askuser
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
154 entrya
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
155 pshs u
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
156 leau parbuff,u point to buffer
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
157 entry0 lda ,x+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
158 cmpa #C$SPAC is it a space (between parameters?)
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
159 beq entry1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
160 cmpa #C$CR
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
161 bne nocr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
162 entry1 clra yes, null it
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
163 nocr sta ,u+ store in buffer
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
164 leay -1,y decrement length counter
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
165 bne entry0
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
166 clr ,u
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
167 tfr u,y
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
168 puls u
946
5c80e10a5d03 renamed variable that was clashing with one in systype
boisy
parents: 943
diff changeset
169 sty <prmend store end of all parameters
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
170 leax parbuff,u load address of parbuff into X
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
171 stx <prmptr save parameter pointer
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
172 entry2 lda ,x
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
173 bne strlen
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
174 leax 1,x
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
175 bra rered2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
176 strlen pshs x
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
177 ldy #0 initialise count
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
178 strl0 lda ,x+ is it a char > null
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
179 cmpa #C$SPAC
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
180 ble strl1 nope, exit
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
181 leay 1,y yep, increment count
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
182 bra strl0 do again
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
183 strl1 puls x
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
184 sty <length store it
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
185
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
186 reread bsr readlin read line from helpfile file
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
187 bcc rered0
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
188 cmpb #E$EOF did we find end-of-file?
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
189 lbeq unknown yep, tell user we don't know his command
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
190 rered0 lbsr compare compare user number with 1st 3 chars of line
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
191 beq reread compare returns 0 if failed
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
192 bsr print else go print the helpfile line
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
193 bcc rered1 exit if I$WritLn problem
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
194 cmpb #E$EOF
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
195 bcs exit
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
196 rered1 ldd <length get length
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
197 ldx prmptr get parameter pointer
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
198 leax d,x add length to it
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
199 leax 1,x increment past null byte
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
200 rered2 clrb
946
5c80e10a5d03 renamed variable that was clashing with one in systype
boisy
parents: 943
diff changeset
201 cmpx <prmend
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
202 blt rered25
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
203 jmp [exitvec,u]
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
204 rered25 stx <prmptr store it
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
205 rered3 lbsr seek0 rewind the file
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
206 bra entry2 loop around again
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
207
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
208 exitok clrb
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
209 exit os9 F$Exit
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
210
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
211 open pshs x
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
212 leax helpfile,pcr point to file name
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
213 lda #READ. read mode
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
214 os9 I$Open
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
215 bcs open0
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
216 sta <path store path number
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
217 open0 puls x,pc
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
218
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
219 readlin pshs x,y
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
220 lda <path get file path number
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
221 ldy #256 read max 256 bytes
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
222 leax filbuff,u into memory pointed to by filbuff
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
223 os9 I$ReadLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
224 puls x,y,pc
322
0d2d4a28c490 cmp.asm and help.asm now assemble correctly
boisy
parents:
diff changeset
225
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
226 print pshs x,y,a
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
227 print2 bsr readlin
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
228 bcs printout
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
229 print3 lda ,x
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
230 cmpa #'@
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
231 beq printout
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
232 lda #1 STDOUT
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
233 leax filbuff,u into memory pointed to by filbuff
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
234 ldy #256 max of 256 chars
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
235 os9 I$WritLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
236 bra print2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
237 printout
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
238 bsr printcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
239 puls x,y,a,pc
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
240
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
241 printcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
242 lda #1
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
243 leax return,pcr
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
244 ldy #256 max of 256 chars
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
245 os9 I$WritLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
246 rts
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
247
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
248 compare pshs x,y
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
249 clr <same comparison indicator
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
250 leay filbuff,u point to file buffer
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
251 lda ,y+ get first char
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
252 cmpa #'@ @ sign?
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
253 bne comp2 branch if not
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
254 ldx prmptr get address of next cmd line param
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
255 comp0 lda ,x+ get char from cmd line
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
256 beq comp1 is it null (end of param)
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
257 ldb ,y+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
258 anda #$DF
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
259 andb #$DF
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
260 pshs a
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
261 cmpb ,s+
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
262 bne comp2 not same, exit
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
263 inc <same yep, in comparison counter
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
264 bra comp0 'round again
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
265 comp1 lda ,y
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
266 cmpa #C$CR was it end of string in helpfile file?
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
267 bne comp2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
268 tst <same test indicator
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
269 puls x,y,pc
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
270 comp2 clr <same clear the counter
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
271 puls x,y,pc
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
272
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
273 unknown
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
274 ldx prmptr put pointer into parameter buffer in X
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
275 lda #1 STDOUT
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
276 ldy <length get length of user's param
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
277 os9 I$Write
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
278 lbcs exit
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
279 leax unkmsg,pcr point to message
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
280 ldy #unkmsgl num of chars to print
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
281 lda #1 to STDOUT
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
282 os9 I$WritLn
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
283 lbcs exit exit if problem with I$Write
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
284 ldx prmptr put point into parameter buffer in X
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
285 ldd <length get length of user's param
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
286 leax d,x add to X
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
287 leax 1,x increment past null byte
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
288 clrb
946
5c80e10a5d03 renamed variable that was clashing with one in systype
boisy
parents: 943
diff changeset
289 cmpx prmend
943
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
290 lblt unk2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
291 jmp [exitvec,u]
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
292 unk2 stx <prmptr store X
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
293 bsr seek0 rewind file
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
294 lbra entry2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
295
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
296 seek0 pshs x,u
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
297 lda <path
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
298 ldx #0
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
299 ldu #0
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
300 os9 I$Seek
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
301 puls x,u,pc
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
302
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
303 helpfile fcc "/DD/SYS/helpmsg"
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
304 fcb 0
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
305 unkmsg fcc /: no help available/
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
306 return fcb C$CR
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
307 unkmsgl equ *-unkmsg
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
308 prompt1 fcc /Hit [ESC] to exit/
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
309 fcb C$CR
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
310 prompt2 fcc /What Subject(s)? /
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
311 prompt2l equ *-prompt2
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
312 avail fcc /Help available on:/
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
313 fcb C$CR
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
314
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
315 emod
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
316 eom equ *
7814ddcf32b1 Rewrote in assembly for size
boisy
parents: 924
diff changeset
317 end