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