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