Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/debug.asm @ 722:edea65d8200b
Fixed apparent bug in L-I code
author | boisy |
---|---|
date | Sat, 04 Jan 2003 23:38:50 +0000 |
parents | dcaff75a19d4 |
children | 29036be0e9d8 |
rev | line source |
---|---|
115 | 1 ******************************************************************** |
2 * debug - 6809 debugger | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
116
diff
changeset
|
8 * 6 From Tandy OS-9 Level One VR 02.00.00 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
9 * 9 From Tandy OS-9 Level Two Development System, BGP 03/01/03 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
10 * back ported to OS-9 Level One |
115 | 11 |
12 nam debug | |
13 ttl 6809 debugger | |
14 | |
15 * Disassembled 02/07/06 13:05:58 by Disasm v1.6 (C) 1988 by RML | |
16 | |
17 ifp1 | |
18 use defsfile | |
19 endc | |
20 | |
21 tylg set Prgrm+Objct | |
22 atrv set ReEnt+rev | |
23 rev set $01 | |
711 | 24 edition set 9 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
25 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
26 * Changable settings |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
27 NumBrkPt equ 12 number of breakpoints |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
28 BuffSiz equ $145 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
29 UnknSiz equ 80 |
115 | 30 |
31 L0000 mod eom,name,tylg,atrv,start,size | |
32 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
33 curraddr rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
34 u0002 rmb 2 |
115 | 35 u0004 rmb 2 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
36 buffptr rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
37 u0008 rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
38 prevaddr rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
39 bptable rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
40 isnarrow rmb 1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
41 * extra memory allocated at start |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
42 rmb (NumBrkPt*3) |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
43 rmb UnknSiz |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
44 rmb BuffSiz |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
45 rmb R$Size |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
46 rmb 44 |
115 | 47 size equ . |
48 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
49 * Debugger Errors |
722 | 50 E$BadCnt equ 0 illegal constant |
51 E$ZerDiv equ 1 divide by zero | |
52 E$MulOvf equ 2 product > 65535 | |
53 E$OpMsng equ 3 operator not follwed by legal operand | |
54 E$RParen equ 4 right paren missing | |
55 E$RBrckt equ 5 right bracket missing | |
56 E$RABrkt equ 6 right angle bracket > missing | |
57 E$IllReg equ 7 illegal register | |
58 E$BytOvf equ 8 value > 255 for byte | |
59 E$CmdErr equ 9 illegal command | |
721 | 60 E$NotRAM equ 10 memory is ROM |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
61 E$BPTFull equ 11 breakpoint table full |
722 | 62 E$NoBkPt equ 12 breakpoint not found |
63 E$BadSWI equ 13 Illegal SWI | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
64 |
115 | 65 name fcs /debug/ |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
116
diff
changeset
|
66 fcb edition |
115 | 67 |
68 L0013 bsr L0021 | |
69 bra L0019 | |
70 L0017 bsr L0027 | |
71 L0019 pshs a | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
72 lda #C$SPAC |
115 | 73 sta ,x+ |
74 puls pc,a | |
75 L0021 exg a,b | |
76 bsr L0027 | |
77 tfr a,b | |
78 L0027 pshs b | |
79 andb #$F0 | |
80 lsrb | |
81 lsrb | |
82 lsrb | |
83 lsrb | |
84 bsr L0035 | |
85 puls b | |
86 andb #$0F | |
87 L0035 cmpb #$09 | |
88 bls L003B | |
89 addb #$07 | |
90 L003B addb #$30 | |
91 stb ,x+ | |
92 rts | |
93 L0040 pshs u,y,b | |
94 leau <L0065,pcr | |
95 ldy #$0005 | |
96 L0049 clr ,s | |
97 L004B subd ,u | |
98 bcs L0053 | |
99 inc ,s | |
100 bra L004B | |
101 L0053 addd ,u++ | |
102 pshs b | |
103 ldb $01,s | |
104 addb #$30 | |
105 stb ,x+ | |
106 puls b | |
107 leay -$01,y | |
108 bne L0049 | |
109 puls pc,u,y,b | |
110 | |
721 | 111 L0065 fdb $2710,$03e8,$0064,$000a,$0001 |
115 | 112 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
113 L006F lbsr EatSpace skip spaces |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
114 leax $01,x point after byte in A |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
115 cmpa #'# decimal specifier? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
116 beq DoDec branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
117 cmpa #'% binary specifier? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
118 beq DoBin branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
119 cmpa #'$ hex specifier? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
120 beq DoHex branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
121 leax -$01,x back up |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
122 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
123 * Make hex number |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
124 DoHex leas -$04,s make room on stack for hex |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
125 bsr Clr4 clear bytes on stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
126 L0086 bsr AtoInt get integer value at ,X |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
127 bcc L00A0 branch if ok |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
128 cmpb #'A may be hex digit.. check for |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
129 lbcs L0110 branch if not |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
130 cmpb #'F check upperbound |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
131 bls L009E branch if ok |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
132 cmpb #'a now check lowercase |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
133 bcs L0110 branch if not |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
134 cmpb #'f check upperbound |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
135 bhi L0110 branch if not ok |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
136 subb #$20 else make uppercase |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
137 L009E subb #$37 and get value |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
138 L00A0 stb ,s save value on stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
139 ldd $02,s get two bytes from stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
140 bita #$F0 upper nibble set? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
141 bne L0123 branch if so |
115 | 142 lslb |
143 rola | |
144 lslb | |
145 rola | |
146 lslb | |
147 rola | |
148 lslb | |
149 rola | |
150 addb ,s | |
151 adca #$00 | |
152 std $02,s | |
153 inc $01,s | |
154 bra L0086 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
155 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
156 * Make decimal number |
721 | 157 DoDec leas -$04,s make room on stack |
158 bsr Clr4 clear it | |
159 L00BE bsr AtoInt convert ASCII char in A | |
115 | 160 bcs L0110 |
721 | 161 stb ,s save integer char |
162 ldd $02,s get word on stack | |
163 lslb | |
164 rola D * 2 | |
165 std $02,s save | |
115 | 166 lslb |
721 | 167 rola D * 4 |
115 | 168 lslb |
721 | 169 rola D * 8 |
115 | 170 bcs L0123 |
721 | 171 addd $02,s add to word on stack |
115 | 172 bcs L0123 |
173 addb ,s | |
174 adca #$00 | |
175 bcs L0123 | |
176 std $02,s | |
177 inc $01,s | |
178 bra L00BE | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
179 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
180 * Make binary number |
721 | 181 DoBin leas -$04,s make room on stack |
182 bsr Clr4 clear it | |
183 L00E4 ldb ,x+ get char at X | |
184 subb #'0 subtract ASCII 0 | |
185 bcs L0110 branch if lower | |
186 lsrb divide by 2 | |
187 bne L0110 branch if not zero | |
188 rol $03,s multiply 2,s * 2 | |
115 | 189 rol $02,s |
721 | 190 bcs L0123 branch if carry set |
115 | 191 inc $01,s |
721 | 192 bra L00E4 get next char |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
193 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
194 * Clear 4 bytes on stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
195 * Exit: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
196 * A,B = 0 |
721 | 197 Clr4 equ * |
198 IFNE H6309 | |
199 clrd | |
200 ELSE | |
201 clra | |
115 | 202 clrb |
721 | 203 ENDC |
115 | 204 std $02,s |
205 std $04,s | |
206 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
207 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
208 * ASCII to Integer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
209 * Entry: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
210 * X = address where byte is |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
211 * Exit: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
212 * X = address + 1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
213 * Carry = clear: B = integer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
214 * Carry = set: B = ASCII char value |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
215 AtoInt ldb ,x+ get char at X |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
216 cmpb #'0 zero? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
217 bcs L0108 branch if lower |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
218 cmpb #'9 9? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
219 bls L010B branch if lower/same |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
220 L0108 orcc #Carry else set carry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
221 rts and return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
222 L010B subb #'0 get real value |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
223 andcc #^Carry clear carry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
224 rts return |
721 | 225 |
226 L0110 leax -$01,x back up X by 1 | |
115 | 227 tst $01,s |
228 beq L011C | |
229 ldd $02,s | |
116 | 230 andcc #^Carry |
115 | 231 bra L0120 |
116 | 232 L011C orcc #Zero |
233 L011E orcc #Carry | |
115 | 234 L0120 leas $04,s |
235 rts | |
116 | 236 L0123 andcc #^Zero |
115 | 237 bra L011E |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
238 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
239 * Eat spaces |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
240 EatSpace lda ,x+ |
687 | 241 cmpa #C$SPAC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
242 beq EatSpace |
115 | 243 leax -$01,x |
244 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
245 |
115 | 246 L0130 pshs x,b,a |
247 lda $03,s | |
248 mul | |
249 pshs b,a | |
250 lda $02,s | |
251 ldb $04,s | |
252 mul | |
253 pshs b,a | |
254 lda $04,s | |
255 ldb $07,s | |
256 bsr L0157 | |
257 lda $05,s | |
258 ldb $06,s | |
259 bsr L0157 | |
116 | 260 andcc #^Carry |
115 | 261 ldd $02,s |
262 ldx ,s | |
263 beq L0154 | |
116 | 264 orcc #Carry |
115 | 265 L0154 leas $08,s |
266 rts | |
267 L0157 mul | |
268 addd $03,s | |
269 std $03,s | |
270 bcc L0160 | |
271 inc $02,s | |
272 L0160 rts | |
273 L0161 pshs y,x,b,a | |
274 ldd ,s | |
275 bne L016B | |
116 | 276 orcc #Carry |
115 | 277 bra L018B |
278 L016B ldd #$0010 | |
279 stb $04,s | |
280 clrb | |
281 L0171 lsl $03,s | |
282 rol $02,s | |
283 rolb | |
284 rola | |
285 subd ,s | |
286 bmi L017F | |
287 inc $03,s | |
288 bra L0181 | |
289 L017F addd ,s | |
290 L0181 dec $04,s | |
291 bne L0171 | |
292 tfr d,x | |
293 ldd $02,s | |
116 | 294 andcc #^Carry |
115 | 295 L018B leas $06,s |
296 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
297 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
298 * Copy from X to Y until byte zero is encountered |
115 | 299 L018E sta ,x+ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
300 CopyXY lda ,y+ |
115 | 301 bne L018E |
302 rts | |
722 | 303 |
304 | |
115 | 305 L0195 pshs u,y |
306 tfr s,u | |
307 bsr L01A7 | |
116 | 308 andcc #^Carry |
115 | 309 puls pc,u,y |
310 L019F tfr u,s | |
116 | 311 orcc #Carry |
115 | 312 puls pc,u,y |
313 L01A5 leax $01,x | |
314 L01A7 bsr L01C9 | |
315 pshs b,a | |
316 L01AB bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
317 cmpa #'- subtract? |
115 | 318 bne L01B9 |
319 bsr L01C7 | |
320 nega | |
321 negb | |
322 sbca #$00 | |
323 bra L01BF | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
324 L01B9 cmpa #'+ add? |
115 | 325 bne L01C5 |
326 bsr L01C7 | |
327 L01BF addd ,s | |
328 std ,s | |
329 bra L01AB | |
330 L01C5 puls pc,b,a | |
331 L01C7 leax $01,x | |
332 L01C9 bsr L01FD | |
333 pshs b,a | |
334 L01CD bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
335 cmpa #'* multiply? |
115 | 336 bne L01E2 |
337 bsr L01FB | |
338 pshs x | |
339 ldx $02,s | |
340 lbsr L0130 | |
341 bcc L01F5 | |
722 | 342 ldb #E$MulOvf |
115 | 343 bra L019F |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
344 L01E2 cmpa #'/ divide? |
115 | 345 bne L01C5 |
346 bsr L01FB | |
347 pshs x | |
348 ldx $02,s | |
349 lbsr L0161 | |
350 bcc L01F5 | |
722 | 351 ldb #E$ZerDiv |
115 | 352 bra L019F |
353 L01F5 puls x | |
354 std ,s | |
355 bra L01CD | |
356 L01FB leax $01,x | |
357 L01FD bsr L0222 | |
358 pshs b,a | |
359 L0201 bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
360 cmpa #'& logical and? |
115 | 361 bne L020F |
362 bsr L0220 | |
363 andb $01,s | |
364 anda ,s | |
365 bra L0219 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
366 L020F cmpa #'! logical or? |
115 | 367 bne L01C5 |
368 bsr L0220 | |
369 orb $01,s | |
370 ora ,s | |
371 L0219 std ,s | |
372 bra L0201 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
373 L021D lbra EatSpace |
115 | 374 L0220 leax $01,x |
375 L0222 bsr L021D | |
722 | 376 cmpa #'^ logical not? |
115 | 377 bne L022E |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
378 bsr ParsExp |
722 | 379 comb not B |
380 coma not A | |
115 | 381 bra L0238 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
382 L022E cmpa #'- minus? |
115 | 383 bne L023B |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
384 bsr ParsExp |
115 | 385 nega |
386 negb | |
387 sbca #$00 | |
388 L0238 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
389 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
390 ParsExp leax $01,x |
115 | 391 L023B bsr L021D |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
392 cmpa #'( open paren? |
115 | 393 bne L0250 |
394 lbsr L01A5 | |
395 pshs b,a | |
396 bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
397 cmpa #') close paren? |
115 | 398 beq L0282 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
399 * IFGT Level-1 |
711 | 400 ldb #$04 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
401 * ELSE |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
402 * ldb <u0004 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
403 * ENDC |
115 | 404 bra L0265 |
687 | 405 L0250 cmpa #'[ |
115 | 406 bne L026A |
407 lbsr L01A5 | |
408 tfr d,y | |
409 ldd ,y | |
410 pshs b,a | |
411 bsr L021D | |
687 | 412 cmpa #'] |
115 | 413 beq L0282 |
722 | 414 ldb #E$RBrckt |
115 | 415 L0265 leas $02,s |
416 L0267 lbra L019F | |
687 | 417 L026A cmpa #'< |
115 | 418 bne L0286 |
419 lbsr L01A5 | |
420 tfr d,y | |
421 clra | |
422 ldb ,y | |
423 pshs b,a | |
424 bsr L021D | |
687 | 425 cmpa #'> |
115 | 426 beq L0282 |
722 | 427 ldb #E$RABrkt |
115 | 428 bra L0265 |
429 L0282 leax $01,x | |
430 puls pc,b,a | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
431 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
432 L0286 cmpa #C$PERD |
115 | 433 bne L028F |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
434 ldd <curraddr |
115 | 435 leax $01,x |
436 rts | |
722 | 437 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
438 L028F cmpa #'' ASCII byte? |
115 | 439 bne L0297 |
440 ldd ,x++ | |
441 clra | |
442 rts | |
722 | 443 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
444 L0297 cmpa #'" ASCII word? |
115 | 445 bne L02A0 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
446 leax $01,x point past quote char |
115 | 447 ldd ,x++ |
448 rts | |
722 | 449 |
687 | 450 L02A0 cmpa #': |
115 | 451 bne L02B4 |
452 leax $01,x | |
722 | 453 bsr GetReg get register that follows : |
454 bcs L0267 branch if error | |
455 tsta is this byte or word register? | |
456 bmi L02B1 branch if word | |
457 clra else clear hi byte | |
458 ldb ,y and get byte at offset | |
115 | 459 rts |
722 | 460 L02B1 ldd ,y get word at offset |
461 L02B3 rts return | |
462 | |
115 | 463 L02B4 lbsr L006F |
464 bcc L02B3 | |
465 beq L02BF | |
466 ldb #$03 | |
467 bra L0267 | |
722 | 468 L02BF ldb #E$BadCnt |
115 | 469 bra L0267 |
721 | 470 |
471 * Parse individual register | |
472 * Entry: | |
473 * X = address of register to find | |
474 * Exit: | |
475 * A = register offset value in table | |
476 * Y = ptr to register offset in stack | |
477 GetReg ldb #RegEnts get number of register entries | |
115 | 478 pshs b |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
479 ldd ,x get first two chars in D |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
480 cmpd #$7370 sp? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
481 beq L02D5 branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
482 cmpd #$5350 SP? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
483 bne L02E2 branch if not |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
484 L02D5 leax $02,x move past two chars |
115 | 485 ldd #$0002 |
486 tfr dp,a | |
487 tfr d,y | |
488 lda #$80 | |
489 bra L0314 | |
721 | 490 L02E2 leay >RegList,pcr |
491 L02E6 lda ,y get first char of register entry | |
492 ldb $01,y get second char of register entry | |
493 bne L02F8 branch if two chars | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
494 cmpa ,x same as user input? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
495 beq L0307 yes, a match |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
496 adda #$20 make lowercase |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
497 cmpa ,x same as user input? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
498 beq L0307 yes, a match |
115 | 499 bra L0318 |
721 | 500 L02F8 cmpd ,x same as user input? |
501 beq L0305 yes, a match | |
502 addd #$2020 make uppercase | |
503 cmpd ,x same as user input? | |
504 bne L0318 branch if not | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
505 L0305 leax $01,x point X to next char |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
506 L0307 leax $01,x point X to next char |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
507 lda $02,y get offset |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
508 tfr a,b transfer to B |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
509 andb #$0F mask off hi nibble |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
510 ldy <u0002 get stack in Y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
511 leay b,y move Y to offset in stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
512 L0314 andcc #^Carry clear carry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
513 puls pc,b return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
514 |
115 | 515 L0318 leay $03,y |
516 dec ,s | |
517 bne L02E6 | |
116 | 518 orcc #Carry |
115 | 519 puls pc,b |
687 | 520 |
721 | 521 * Register list for 6809/6309 |
522 RegList fcc "CC" | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
523 fcb R$CC |
115 | 524 fcc "DP" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
525 fcb R$DP |
115 | 526 fcc "PC" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
527 fcb $80+R$PC |
115 | 528 fcc "A" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
529 fcb $00,R$A |
115 | 530 fcc "B" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
531 fcb $00,R$B |
115 | 532 fcc "D" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
533 fcb $00,$80+R$A |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
534 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
535 fcc "E" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
536 fcb $00,R$E |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
537 fcc "F" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
538 fcb $00,R$F |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
539 fcc "W" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
540 fcb $00,$80+R$E |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
541 ENDC |
115 | 542 fcc "X" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
543 fcb $00,$80+R$X |
115 | 544 fcc "Y" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
545 fcb $00,$80+R$Y |
115 | 546 fcc "U" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
547 fcb $00,$80+R$U |
721 | 548 RegEnts equ (*-RegList)/3 |
115 | 549 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
550 start leas >size,u point S to end of memory |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
551 leas -R$Size,s back off size of register stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
552 sts <u0002 save off |
115 | 553 sts <u0004 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
554 leay >DefBrk,pcr |
691 | 555 sty R$PC,s |
556 lda #Entire | |
557 sta R$CC,s | |
558 tfr s,x X = size-R$Size | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
559 leax >-BuffSiz,x back off appropriate byte count |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
560 stx <buffptr and save off ptr for line buffer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
561 leax <-UnknSiz,x back off more |
115 | 562 stx <u0008 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
563 leax <-NumBrkPt*3,x |
722 | 564 stx <bptable save pointer to breakpoint table |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
565 clr <curraddr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
566 clr <curraddr+1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
567 clr <isnarrow |
711 | 568 pshs y,x,b,a |
569 lda #$01 stdout | |
570 ldb #SS.ScSiz get screen size | |
722 | 571 os9 I$GetStt do it! |
711 | 572 bcc L0380 |
573 cmpb #E$UnkSvc | |
574 beq L0387 | |
575 puls x,y,b,a | |
576 lbra L0735 | |
577 L0380 cmpx #80 80 columns? | |
578 beq L0387 branch if so | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
579 inc <isnarrow |
711 | 580 L0387 puls x,y,b,a |
722 | 581 * Clear breakpoint table |
115 | 582 L036A clr ,x+ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
583 cmpx <buffptr |
115 | 584 bcs L036A |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
585 leax >IcptRtn,pcr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
586 lda #$01 SSWI Vector 1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
587 os9 F$SSWi set software interrupt routine |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
588 os9 F$Icpt set intercept routine |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
589 lbsr WritCR write carriage return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
590 ldx <buffptr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
591 leay >Title,pcr point to title |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
592 bsr L03C2 print it |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
593 lbsr WritCR2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
594 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
595 * Show prompt and get input from standard input to process |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
596 GetInput leay >Prompt,pcr point to prompt |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
597 lbsr L07EF print it |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
598 lbsr ReadLine read line from std input |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
599 leay >CmdTbl,pcr point to command table |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
600 lda ,x get character from read buffer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
601 cmpa #'a compare against lowercase a |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
602 bcs L03A2 branch if lower |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
603 suba #$20 make uppercase |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
604 sta ,x and save |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
605 L03A2 leay $03,y walk through table |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
606 lda ,y get char to compare against in A |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
607 beq SyntxErr branch if done |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
608 cmpa ,x same? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
609 bne L03A2 if not, get next |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
610 * Here we have a command match, dispatch it |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
611 leax $01,x move past char |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
612 ldd $01,y get handle address |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
613 leau >L0000,pcr point to start of module |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
614 jsr d,u and branch to subroutine |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
615 bra GetInput |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
616 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
617 * Command wasn't recognized |
722 | 618 SyntxErr ldb #E$CmdErr |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
619 bsr ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
620 bra GetInput |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
621 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
622 ShowErr os9 F$PErr |
115 | 623 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
624 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
625 L03C2 lbra CopyXY |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
626 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
627 * Show byte at current memptr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
628 DotCmd lda ,x get byte after cmd byte |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
629 cmpa #C$PERD is it a period? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
630 bne L03CF branch if not |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
631 ldd <prevaddr else get previous address |
115 | 632 bra L03DC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
633 L03CF cmpa #C$CR cr? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
634 bne L03D7 branch if not |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
635 L03D3 ldd <curraddr |
115 | 636 bra L03DC |
637 L03D7 lbsr L0195 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
638 bcs ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
639 L03DC ldx <curraddr get current memory loc |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
640 stx <prevaddr store in previous memory loc |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
641 std <curraddr and save D in new memory loc |
115 | 642 pshs b,a |
643 bsr L0415 | |
644 ldd ,s | |
645 lbsr L0013 | |
646 puls y | |
647 ldb ,y | |
648 lbsr L0027 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
649 lbra WritCR2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
650 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
651 * Show previous byte |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
652 PrevByte ldd <curraddr get current memory address |
721 | 653 IFNE H6309 |
654 decd | |
655 ELSE | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
656 subd #$0001 subtract 1 |
721 | 657 ENDC |
115 | 658 bra L03DC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
659 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
660 * Set byte at current location |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
661 SetLoc bsr L043F |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
662 bcs ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
663 ldx <curraddr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
664 stb ,x store byte at curraddr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
665 cmpb ,x compare (in case it is ROM) |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
666 beq NextByte branch if equal |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
667 ldb #E$NotRAM else load B with error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
668 bsr ShowErr and show it |
115 | 669 bra L03D3 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
670 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
671 * Show next byte |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
672 NextByte ldd <curraddr get current memory address |
721 | 673 IFNE H6309 |
674 incd | |
675 ELSE | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
676 addd #$0001 add one to it |
721 | 677 ENDC |
115 | 678 bra L03DC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
679 L0415 ldx <buffptr load X with buffer pointer |
115 | 680 pshs b,a |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
681 leay >Spaces,pcr point to spaces |
115 | 682 bsr L03C2 |
683 puls pc,b,a | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
684 |
722 | 685 * Calc expression |
686 Calc lbsr L0195 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
687 bcs ShowErr |
115 | 688 bsr L0415 |
689 pshs b,a | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
690 lda #'$ hex prefix |
115 | 691 sta ,x+ |
692 lda ,s | |
693 lbsr L0013 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
694 lda #'# decimal prefix |
115 | 695 sta ,x+ |
696 puls b,a | |
697 lbsr L0040 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
698 lbra WritCR2 |
115 | 699 L043F lbsr L0195 |
700 bcs L044B | |
701 tsta | |
702 beq L044B | |
722 | 703 ldb #E$BytOvf |
116 | 704 orcc #Carry |
115 | 705 L044B rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
706 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
707 * Show all registers |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
708 ShowRegs lbsr L0512 |
115 | 709 beq L04AF |
721 | 710 lbsr GetReg |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
711 lbcs ShowErr |
721 | 712 pshs y,a save pointer to register and offset |
115 | 713 lbsr L0512 |
714 bne L0475 | |
715 bsr L0415 | |
721 | 716 puls y,a retreive pointer to register and offset |
717 tsta test A | |
718 bpl L046D branch if positive, means one byte3 | |
719 ldd ,y load D with two bytes | |
115 | 720 lbsr L0021 |
721 bra L0472 | |
721 | 722 L046D ldb ,y load B with one byte |
115 | 723 lbsr L0027 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
724 L0472 lbra WritCR2 |
115 | 725 L0475 lda ,s+ |
726 bpl L0485 | |
727 lbsr L0195 | |
728 puls y | |
729 lbcs L054E | |
730 std ,y | |
731 rts | |
732 L0485 bsr L043F | |
733 puls y | |
734 lbcs L054E | |
735 stb ,y | |
736 rts | |
687 | 737 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
738 ShrtHdr fcc "PC=" |
115 | 739 fcb $00 |
740 fcc "A=" | |
741 fcb $00 | |
742 fcc "B=" | |
743 fcb $00 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
744 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
745 fcc "E=" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
746 fcb $00 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
747 fcc "F=" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
748 fcb $00 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
749 ENDC |
115 | 750 fcc "CC=" |
751 fcb $00 | |
752 fcc "DP=" | |
753 fcb $00 | |
754 fcc "SP=" | |
755 fcb $00 | |
756 fcc "X=" | |
757 fcb $00 | |
758 fcc "Y=" | |
759 fcb $00 | |
760 fcc "U=" | |
761 fcb $00 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
762 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
763 L04AF tst <isnarrow wide screen? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
764 beq WidRegs branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
765 pshs u save U |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
766 ldx <buffptr point to buffer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
767 leay <ShrtHdr,pcr |
115 | 768 ldu <u0002 |
769 lbsr L03C2 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
770 ldd R$PC,u |
720 | 771 IFNE H6309 |
772 lbsr L0505 | |
773 ELSE | |
115 | 774 bsr L0505 |
720 | 775 ENDC |
115 | 776 lbsr L03C2 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
777 ldb R$A,u |
720 | 778 IFNE H6309 |
779 lbsr L050F | |
780 ELSE | |
115 | 781 bsr L050F |
720 | 782 ENDC |
115 | 783 lbsr L03C2 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
784 ldb R$B,u |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
785 bsr L050F |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
786 lbsr L03C2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
787 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
788 ldb R$E,u |
115 | 789 bsr L050F |
790 lbsr L03C2 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
791 ldb R$F,u |
115 | 792 bsr L050F |
721 | 793 pshs y |
794 lbsr WritCR2 | |
795 puls y | |
115 | 796 lbsr L03C2 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
797 ENDC |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
798 ldb R$CC,u |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
799 bsr L050F |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
800 lbsr L03C2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
801 ldb R$DP,u |
115 | 802 bsr L050F |
721 | 803 IFEQ H6309 |
115 | 804 pshs y |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
805 lbsr WritCR2 |
115 | 806 puls y |
721 | 807 ENDC |
115 | 808 lbsr L03C2 |
809 tfr u,d | |
810 bsr L0505 | |
811 lbsr L03C2 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
812 ldd R$X,u |
115 | 813 bsr L0505 |
814 lbsr L03C2 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
815 ldd R$Y,u |
115 | 816 bsr L0505 |
817 lbsr L03C2 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
818 ldd R$U,u |
115 | 819 bsr L0505 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
820 lbsr WritCR2 |
115 | 821 puls pc,u |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
822 * Show registers in wide form |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
823 WidRegs lbsr L0415 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
824 leay >RegHdr,pcr |
711 | 825 lbsr L03C2 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
826 lbsr WritCR2 |
711 | 827 lbsr L0415 |
828 ldd <u0002 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
829 bsr L0505 show SP |
711 | 830 ldy <u0002 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
831 bsr L050D show CC |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
832 bsr L050D show A |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
833 bsr L050D show B |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
834 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
835 bsr L050D show E |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
836 bsr L050D show F |
711 | 837 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
838 bsr L050D show DP |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
839 bsr L0550 show X |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
840 bsr L0550 show Y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
841 bsr L0550 show U |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
842 bsr L0550 show PC |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
843 lbra WritCR2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
844 |
711 | 845 L0550 ldd ,y++ |
115 | 846 L0505 lbra L0013 |
847 L0508 ldd ,y++ | |
848 lbra L0021 | |
711 | 849 L050D ldb ,y+ |
115 | 850 L050F lbra L0017 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
851 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
852 * Eat spaces and compare char with CR |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
853 L0512 lbsr EatSpace |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
854 cmpa #C$CR |
115 | 855 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
856 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
857 * Set/show breakpoints |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
858 SetBkpt bsr L0512 any parameters? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
859 bne L0538 branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
860 * Here we show all breakpoints |
115 | 861 lbsr L0415 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
862 ldy <bptable get breakpoints base |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
863 ldb #NumBrkPt get breakpoint count |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
864 pshs b save on stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
865 L0526 ldd ,y empty? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
866 beq L052D branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
867 lbsr L0013 else show breakpoint at Y |
115 | 868 L052D leay $03,y |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
869 dec ,s dec breakpoint count |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
870 bne L0526 continue searching |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
871 leas $01,s kill byte on stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
872 lbra WritCR2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
873 * Set breakpoint here |
115 | 874 L0538 lbsr L0195 |
875 bcs L054E | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
876 pshs b,a save desired breakpoint address |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
877 bsr SrchBkpt search to see if it is already in table |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
878 beq L0551 if duplicate, just exit |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
879 ldd #$0000 else load D with empty address |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
880 bsr SrchBkpt search for empty |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
881 beq L0551 branch if found |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
882 ldb #E$BPTFull else table is full |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
883 leas $02,s clean up stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
884 L054E lbra ShowErr and show error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
885 L0551 puls b,a get breakpoint address off stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
886 std ,y and save it at breakpoint entry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
887 rts then return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
888 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
889 * Search for existing breakpoint that matches address in D |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
890 SrchBkpt pshs u save U |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
891 tfr d,u transfer addr to search in U |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
892 ldb #NumBrkPt get number of breakpoints |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
893 ldy <bptable point Y to base of breakpoints |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
894 L055F cmpu ,y match? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
895 beq L056D branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
896 leay $03,y else move to next entry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
897 decb dec couner |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
898 bne L055F if not 0, continue search |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
899 * IFGT Level-1 |
722 | 900 ldb #E$NoBkPt |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
901 * ELSE |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
902 * ldb <bptable |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
903 * ENDC |
116 | 904 andcc #^Zero |
115 | 905 L056D puls pc,u |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
906 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
907 * Kill breakpoint(s) |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
908 KillBkpt bsr L0512 any parameters? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
909 beq KillAll branch if none |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
910 lbsr L0195 else get parameter |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
911 bcs L054E branch if error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
912 bsr SrchBkpt |
115 | 913 bne L054E |
914 clra | |
915 clrb | |
916 std ,y | |
917 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
918 * Kill all breakpoints |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
919 KillAll ldy <bptable |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
920 ldb #NumBrkPt*3 |
115 | 921 L0586 clr ,y+ |
922 decb | |
923 bne L0586 | |
924 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
925 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
926 * Go at address |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
927 GoPC bsr L0512 any parameters? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
928 beq L059A branch if none |
115 | 929 lbsr L0195 |
930 bcs L054E | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
931 ldy <u0002 get execution stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
932 std R$PC,y save new PC |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
933 * Now we set up all breakpoints in memory |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
934 L059A ldy <bptable |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
935 ldb #R$Size get register size |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
936 ldx <u0002 point to registers |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
937 ldx R$PC,x get PC |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
938 L05A3 ldu ,y get breakpoint at entry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
939 beq L05B3 branch if empty |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
940 lda ,u get byte at breakpoint address |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
941 sta $02,y save in breakpoint entry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
942 cmpx ,y is breakpoint same as PC? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
943 beq L05B3 branch if so |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
944 lda #$3F else take SWI instruction |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
945 sta ,u and store it at address of breakpoint |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
946 L05B3 leay $03,y move to next breakpoint entry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
947 decb decrement |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
948 bne L05A3 branch if not complete |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
949 lds <u0002 get execution stack |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
950 rti run program |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
951 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
952 MemDump bsr L0613 |
115 | 953 bcs L054E |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
954 tst <isnarrow |
711 | 955 bne L0615 |
956 orb #$0F | |
957 bra L0617 | |
958 L0615 orb #$07 | |
959 L0617 exg d,u | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
960 tst <isnarrow |
711 | 961 bne L0621 |
962 andb #$F0 | |
963 bra L0623 | |
964 L0621 andb #$F8 | |
965 L0623 pshs u,b,a | |
115 | 966 cmpd $02,s |
967 bcc L05D9 | |
968 L05CD ldy ,s | |
969 leay -$01,y | |
970 cmpy $02,s | |
971 leay $01,y | |
972 bcs L05DB | |
973 L05D9 puls pc,u,b,a | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
974 L05DB ldx <buffptr |
115 | 975 tfr y,d |
976 lbsr L0013 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
977 tst <isnarrow |
711 | 978 bne L0647 |
722 | 979 ldb #8 |
711 | 980 bra L0649 |
722 | 981 L0647 ldb #4 |
711 | 982 L0649 pshs b |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
983 L05E6 tst <isnarrow |
711 | 984 bne L0654 |
985 lbsr L0550 | |
986 bra L0657 | |
987 L0654 lbsr L0508 | |
988 L0657 dec ,s | |
115 | 989 bne L05E6 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
990 tst <isnarrow |
711 | 991 bne L0663 |
722 | 992 ldb #16 |
711 | 993 bra L0668 |
994 L0663 lbsr L0019 | |
722 | 995 ldb #8 |
711 | 996 L0668 stb ,s |
115 | 997 ldy $01,s |
998 L05F7 lda ,y+ | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
999 cmpa #'~ |
115 | 1000 bhi L0601 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1001 cmpa #C$SPAC |
115 | 1002 bcc L0603 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1003 L0601 lda #'. |
115 | 1004 L0603 sta ,x+ |
1005 dec ,s | |
1006 bne L05F7 | |
1007 leas $01,s | |
1008 sty ,s | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1009 lbsr WritCR2 |
115 | 1010 bra L05CD |
1011 L0613 lbsr L0195 | |
1012 bcs L061D | |
1013 tfr d,u | |
1014 lbsr L0195 | |
1015 L061D rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1016 |
722 | 1017 ClearMem bsr L0613 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1018 lbcs ShowErr |
722 | 1019 pshs b,a save fill word |
115 | 1020 L0626 cmpu ,s |
1021 bls L062D | |
1022 puls pc,b,a | |
1023 L062D ldd #$8008 | |
1024 sta ,u | |
1025 L0632 cmpa ,u | |
1026 bne L063E | |
1027 lsra | |
1028 lsr ,u | |
1029 decb | |
1030 bne L0632 | |
1031 bra L064E | |
1032 L063E lbsr L0415 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1033 ldd #$2D20 dash, space |
115 | 1034 std ,x++ |
1035 tfr u,d | |
1036 lbsr L0021 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1037 lbsr WritCR2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1038 L064E leau 1,u |
115 | 1039 bra L0626 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1040 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1041 * Intercept routine |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1042 IcptRtn clra |
115 | 1043 tfr a,dp |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1044 IFEQ Level-1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1045 ldx <D.Proc get curr proc ptr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1046 lda P$ADDR,x get hi word of user addr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1047 tfr a,dp transfer it to DP |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1048 ENDC |
711 | 1049 sts <u0002 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1050 ldd R$PC,s |
721 | 1051 IFNE H6309 |
1052 decd | |
1053 ELSE | |
115 | 1054 subd #$0001 |
721 | 1055 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1056 std R$PC,s |
115 | 1057 lds <u0004 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1058 lbsr SrchBkpt |
115 | 1059 beq L0672 |
722 | 1060 ldb #E$BadSWI |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1061 lbsr ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1062 * Clear breakpoints in memory |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1063 L0672 ldy <bptable point to break point table |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1064 ldb #NumBrkPt get number of entries |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1065 L0677 ldx ,y get address in entry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1066 beq L067F branch if empty |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1067 lda $02,y get saved byte |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1068 sta ,x restore it |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1069 L067F leay $03,y move to next entry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1070 decb dec counter |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1071 bne L0677 continue if not zero |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1072 lbsr WritCR |
115 | 1073 lbsr L0415 |
1074 leay >L07A9,pcr | |
1075 lbsr L03C2 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1076 lbsr WritCR2 |
115 | 1077 lbsr L04AF |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1078 lbra GetInput |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1079 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1080 LinkMod bsr LinkIt link to module |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1081 lbcs ShowErr branch if error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1082 ldx <buffptr |
115 | 1083 tfr u,d |
1084 pshs u | |
1085 lbsr L03DC | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1086 lbsr WritCR2 |
115 | 1087 puls u |
1088 bra L06CC | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1089 |
721 | 1090 LinkIt lbsr EatSpace skip over blank spaces at X |
115 | 1091 lda #$00 |
721 | 1092 os9 F$Link link to module name at X |
115 | 1093 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1094 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1095 * Prepare module for execution |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1096 PrepMod bsr LinkIt |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1097 lbcs ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1098 ldd M$Mem,u get memory requirements |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1099 addd #512 add an extra 512 bytes |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1100 os9 F$Mem allocate, Y = upperbound |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1101 bcc UnlinkIt branch if ok |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1102 lbsr ShowErr show error |
711 | 1103 L06CC equ * |
1104 IFEQ Level-1 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1105 os9 F$UnLink |
711 | 1106 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1107 rts and return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1108 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1109 UnlinkIt os9 F$UnLink unlink module |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1110 pshs u,y,x save u,y,x |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1111 L06D5 lda ,x+ get next parameter char |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1112 cmpa #C$CR carriage return? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1113 bne L06D5 branch if not |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1114 clrb start at zero |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1115 L06DC lda ,-x get parameter char |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1116 sta ,-y store in buffer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1117 incb continue |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1118 cmpx ,s reached start of parameter? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1119 bhi L06DC branch if not |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1120 sty -R$U,y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1121 leay -R$Size,y |
115 | 1122 sty <u0002 |
1123 clra | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1124 std R$A,y |
115 | 1125 puls u,x,b,a |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1126 stx R$Y,y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1127 ldd M$Exec,u get exec offset in D |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1128 leax d,u point X to execution address |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1129 stx R$PC,y save at PC |
115 | 1130 tfr cc,a |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1131 ora #Entire |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1132 sta R$CC,y |
115 | 1133 tfr dp,a |
1134 adda #$02 | |
1135 clrb | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1136 std R$U,y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1137 sta R$DP,y |
115 | 1138 lbra L04AF |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1139 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1140 * Fork program (default is shell) |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1141 ForkPrg lbsr EatSpace skip leading spaces |
115 | 1142 clra |
1143 clrb | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1144 tfr x,u move param ptr to U |
115 | 1145 tfr d,y |
1146 L0715 leay $01,y | |
1147 lda ,x+ | |
687 | 1148 cmpa #C$CR |
115 | 1149 bne L0715 |
1150 clra | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1151 leax <ShellNam,pcr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1152 os9 F$Fork fork shell plus any parameters |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1153 bcs L0729 branch if error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1154 os9 F$Wait wait for shell to finish |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1155 L0729 lbcs ShowErr branch if error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1156 rts and return |
687 | 1157 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1158 ShellNam fcc "shell" |
687 | 1159 fcb $00 |
1160 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1161 * Exit without error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1162 ExitOk clrb |
711 | 1163 L0735 os9 F$Exit |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1164 |
722 | 1165 * Search for byte or word from . to end address |
1166 * Syntax: S endaddr byte | |
1167 * S endaddr word | |
1168 SrchMem lbsr L0613 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1169 lbcs ShowErr |
115 | 1170 pshs u |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1171 ldx <curraddr |
722 | 1172 tsta byte or word? |
1173 bne L0750 branch if word | |
1174 L0746 cmpb ,x+ byte in B match byte at ,X? | |
1175 beq L075C branch if so | |
1176 cmpx ,s is X equal to end? | |
1177 bne L0746 branch if not | |
1178 puls pc,u else we're done | |
1179 L0750 cmpd ,x+ byte in B match byte at ,X? | |
1180 beq L075C branch if so | |
1181 * IFGT Level-1 | |
115 | 1182 cmpx ,s |
722 | 1183 * ELSE |
1184 * cmps ,s this appears to be a bug | |
1185 * ENDC | |
1186 bne L0750 branch if not | |
115 | 1187 puls pc,u |
722 | 1188 L075C leax -$01,x back up to mem location found |
1189 tfr x,d put memory location in D | |
1190 leas $02,s wipe out stack | |
115 | 1191 lbra L03DC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1192 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1193 DefBrk swi |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1194 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1195 Title fcc "Interactive Debugger" |
115 | 1196 fcb $00 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1197 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1198 Prompt fcc "DB: " |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1199 fcb $00 |
721 | 1200 Spaces fcc " " |
115 | 1201 fcb $00 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1202 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1203 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1204 RegHdr fcc " SP CC A B E F DP X Y U PC" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1205 ELSE |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1206 RegHdr fcc " SP CC A B DP X Y U PC" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1207 ENDC |
115 | 1208 fcb $00 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1209 |
115 | 1210 L07A9 fcc "BKPT" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1211 CmdTbl fcc ": " |
115 | 1212 fcb $00 |
687 | 1213 fcc /./ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1214 fdb DotCmd |
687 | 1215 fcc /=/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1216 fdb SetLoc |
687 | 1217 fcb C$CR |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1218 fdb NextByte |
687 | 1219 fcb C$SPAC |
722 | 1220 fdb Calc |
687 | 1221 fcc /-/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1222 fdb PrevByte |
687 | 1223 fcc /:/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1224 fdb ShowRegs |
687 | 1225 fcc /K/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1226 fdb KillBkpt |
687 | 1227 fcc /M/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1228 fdb MemDump |
687 | 1229 fcc /C/ |
722 | 1230 fdb ClearMem |
687 | 1231 fcc /B/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1232 fdb SetBkpt |
687 | 1233 fcc /G/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1234 fdb GoPC |
687 | 1235 fcc /L/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1236 fdb LinkMod |
687 | 1237 fcc /E/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1238 fdb PrepMod |
687 | 1239 fcc /$/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1240 fdb ForkPrg |
687 | 1241 fcc /Q/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1242 fdb ExitOk |
687 | 1243 fcc /S/ |
722 | 1244 fdb SrchMem |
115 | 1245 fcb $00 |
687 | 1246 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1247 * Append CR and write to std out |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1248 WritCR ldx <buffptr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1249 WritCR2 lda #C$CR |
687 | 1250 sta ,x+ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1251 ldx <buffptr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1252 ldy #81 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1253 bra WrStdOut |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1254 |
115 | 1255 L07EF tfr y,x |
1256 tfr y,u | |
1257 ldy #$0000 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1258 L07F7 ldb ,u+ get next char |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1259 beq WrStdOut write it |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1260 leay $01,y increase Y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1261 bra L07F7 get more |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1262 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1263 * Write To Standard Output |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1264 * Entry: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1265 * X = address of buffer to write |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1266 WrStdOut lda #$01 stdout |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1267 os9 I$WritLn write it! |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1268 ldx <buffptr |
115 | 1269 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1270 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1271 * Read From To Standard Input |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1272 * Exit: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1273 * X = address of buffer to data read |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1274 ReadLine ldx <buffptr point to buffer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1275 ldy #80 read up to 80 chars |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1276 clra from stdin |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1277 os9 I$ReadLn do it! |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1278 ldx <buffptr reload X with line |
115 | 1279 rts |
1280 | |
1281 emod | |
1282 eom equ * | |
1283 end |