Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/debug.asm @ 2798:b70d93f8d7ce lwtools-port
Updated coco1/modules/makefile and coco3/modules/makefile to help resolve issues with i(x) and s(x) descriptors.
Updated level1/coco1/modules/makefile & level2/coco3/modules/makefile
so that correct values would be sent to assembler when
building superdesc.asm for s(x).dd and i(x).dd descriptors.
author | drencor-xeen |
---|---|
date | Mon, 28 Jan 2013 16:13:05 -0600 |
parents | 4604b8d90bd5 |
children |
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. |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
18 * |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
19 * 11 2004/06/23 Boisy G. Pitre |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
20 * Verbose error messages, added System Debug code for potential |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
21 * system-state debugger talking to an A6551 at $FF68. |
115 | 22 |
23 nam debug | |
1166 | 24 ttl 6809/6309 debugger |
115 | 25 |
26 * Disassembled 02/07/06 13:05:58 by Disasm v1.6 (C) 1988 by RML | |
27 | |
28 ifp1 | |
29 use defsfile | |
30 endc | |
31 | |
924 | 32 * Changable settings |
33 NumBrkPt equ 12 number of breakpoints | |
34 BuffSiz equ $145 | |
35 UnknSiz equ 80 | |
36 | |
115 | 37 tylg set Prgrm+Objct |
38 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1166
diff
changeset
|
39 rev set $00 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
40 edition set 11 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
41 |
115 | 42 L0000 mod eom,name,tylg,atrv,start,size |
43 | |
924 | 44 org 0 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
45 curraddr rmb 2 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
46 regstack rmb 2 |
115 | 47 u0004 rmb 2 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
48 buffptr rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
49 u0008 rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
50 prevaddr rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
51 bptable rmb 2 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
52 isnarrow rmb 1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
53 * 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
|
54 rmb (NumBrkPt*3) |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
55 rmb UnknSiz |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
56 rmb BuffSiz |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
57 rmb R$Size |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
58 rmb 44 |
115 | 59 size equ . |
60 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
61 * Debugger Errors |
722 | 62 E$BadCnt equ 0 illegal constant |
63 E$ZerDiv equ 1 divide by zero | |
64 E$MulOvf equ 2 product > 65535 | |
65 E$OpMsng equ 3 operator not follwed by legal operand | |
66 E$RParen equ 4 right paren missing | |
67 E$RBrckt equ 5 right bracket missing | |
68 E$RABrkt equ 6 right angle bracket > missing | |
69 E$IllReg equ 7 illegal register | |
70 E$BytOvf equ 8 value > 255 for byte | |
71 E$CmdErr equ 9 illegal command | |
721 | 72 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
|
73 E$BPTFull equ 11 breakpoint table full |
722 | 74 E$NoBkPt equ 12 breakpoint not found |
75 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
|
76 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
77 name equ * |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
78 IFEQ SYSDEBUG-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
79 fcc /sys/ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
80 ENDC |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
81 fcs /debug/ |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
116
diff
changeset
|
82 fcb edition |
115 | 83 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
84 * Convert word in D to Hex string at X and add space |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
85 Word2HexSpc |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
86 bsr Word2Hex |
115 | 87 bra L0019 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
88 L0017 bsr Byte2Hex |
115 | 89 L0019 pshs a |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
90 lda #C$SPAC |
115 | 91 sta ,x+ |
92 puls pc,a | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
93 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
94 * Convert word in D to Hex string at X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
95 Word2Hex exg a,b swap A/B |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
96 bsr Byte2Hex work on upper 16 bits (now in B) |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
97 tfr a,b and work on B |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
98 * Convert byte in B to Hex string at X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
99 Byte2Hex pshs b save copy of B on stack |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
100 andb #$F0 mask upper nibble |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
101 lsrb and bring to lower nibble |
115 | 102 lsrb |
103 lsrb | |
104 lsrb | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
105 bsr Nibl2Hex convert byte in B to ASCII |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
106 puls b get saved B |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
107 andb #$0F do lower nibble |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
108 * Convert lower nibble in B to Hex character at X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
109 Nibl2Hex cmpb #$09 9? |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
110 bls n@ branch if lower/same |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
111 addb #$07 else add 7 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
112 n@ addb #'0 and ASCII 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
113 stb ,x+ save B |
115 | 114 rts |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
115 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
116 * Convert byte in B to Decimal string at X (3 places) |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
117 Word2Dec3 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
118 pshs u,y,b |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
119 clra |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
120 leau <DeciTbl+4,pcr point to deci-table |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
121 ldy #$0003 number of decimal places |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
122 bra w1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
123 * Convert word in D to Decimal string at X (5 places) |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
124 Word2Dec5 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
125 pshs u,y,b |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
126 leau <DeciTbl,pcr point to deci-table |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
127 ldy #$0005 number of decimal places |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
128 w1 clr ,s clear byte on stack |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
129 w2 subd ,u subtract current place from D |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
130 bcs w3 branch if negative |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
131 inc ,s else increment place |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
132 bra w2 and continue |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
133 w3 addd ,u++ re-normalize D |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
134 pshs b save B |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
135 ldb $01,s get saved B |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
136 addb #'0 add ASCII 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
137 stb ,x+ and save |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
138 puls b retrieve saved B |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
139 leay -$01,y subtract Y |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
140 bne w1 branch if not done |
115 | 141 puls pc,u,y,b |
142 | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
143 DeciTbl fdb 10000,1000,100,10,1 |
115 | 144 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
145 * Evaluate number specifier at X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
146 EvalSpec lbsr EatSpace skip spaces |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
147 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
|
148 cmpa #'# decimal specifier? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
149 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
|
150 cmpa #'% binary specifier? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
151 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
|
152 cmpa #'$ hex specifier? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
153 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
|
154 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
|
155 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
156 * Make hex number |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
157 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
|
158 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
|
159 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
|
160 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
|
161 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
|
162 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
|
163 cmpb #'F check upperbound |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
164 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
|
165 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
|
166 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
|
167 cmpb #'f check upperbound |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
168 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
|
169 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
|
170 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
|
171 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
|
172 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
|
173 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
|
174 bne L0123 branch if so |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
175 IFNE H6309 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
176 lsld |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
177 lsld |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
178 lsld |
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 |
115 | 181 lslb |
182 rola | |
183 lslb | |
184 rola | |
185 lslb | |
186 rola | |
187 lslb | |
188 rola | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
189 ENDC |
115 | 190 addb ,s |
191 adca #$00 | |
192 std $02,s | |
193 inc $01,s | |
194 bra L0086 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
195 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
196 * Make decimal number |
721 | 197 DoDec leas -$04,s make room on stack |
198 bsr Clr4 clear it | |
199 L00BE bsr AtoInt convert ASCII char in A | |
115 | 200 bcs L0110 |
721 | 201 stb ,s save integer char |
202 ldd $02,s get word on stack | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
203 IFNE H6309 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
204 lsld |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
205 ELSE |
721 | 206 lslb |
207 rola D * 2 | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
208 ENDC |
721 | 209 std $02,s save |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
210 IFNE H6309 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
211 lsld |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
212 lsld |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
213 ELSE |
115 | 214 lslb |
721 | 215 rola D * 4 |
115 | 216 lslb |
721 | 217 rola D * 8 |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
218 ENDC |
115 | 219 bcs L0123 |
721 | 220 addd $02,s add to word on stack |
115 | 221 bcs L0123 |
222 addb ,s | |
223 adca #$00 | |
224 bcs L0123 | |
225 std $02,s | |
226 inc $01,s | |
227 bra L00BE | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
228 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
229 * Make binary number |
721 | 230 DoBin leas -$04,s make room on stack |
231 bsr Clr4 clear it | |
232 L00E4 ldb ,x+ get char at X | |
233 subb #'0 subtract ASCII 0 | |
234 bcs L0110 branch if lower | |
235 lsrb divide by 2 | |
236 bne L0110 branch if not zero | |
237 rol $03,s multiply 2,s * 2 | |
115 | 238 rol $02,s |
721 | 239 bcs L0123 branch if carry set |
115 | 240 inc $01,s |
721 | 241 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
|
242 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
243 * 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
|
244 * Exit: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
245 * A,B = 0 |
721 | 246 Clr4 equ * |
247 IFNE H6309 | |
248 clrd | |
249 ELSE | |
250 clra | |
115 | 251 clrb |
721 | 252 ENDC |
115 | 253 std $02,s |
254 std $04,s | |
255 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
256 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
257 * ASCII to Integer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
258 * Entry: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
259 * 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
|
260 * Exit: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
261 * X = address + 1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
262 * Carry = clear: B = integer |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
263 * 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
|
264 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
|
265 cmpb #'0 zero? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
266 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
|
267 cmpb #'9 9? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
268 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
|
269 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
|
270 rts and return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
271 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
|
272 andcc #^Carry clear carry |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
273 rts return |
721 | 274 |
275 L0110 leax -$01,x back up X by 1 | |
115 | 276 tst $01,s |
277 beq L011C | |
278 ldd $02,s | |
116 | 279 andcc #^Carry |
115 | 280 bra L0120 |
116 | 281 L011C orcc #Zero |
282 L011E orcc #Carry | |
115 | 283 L0120 leas $04,s |
284 rts | |
116 | 285 L0123 andcc #^Zero |
115 | 286 bra L011E |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
287 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
288 * Eat spaces |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
289 EatSpace lda ,x+ |
687 | 290 cmpa #C$SPAC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
291 beq EatSpace |
115 | 292 leax -$01,x |
293 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
294 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
295 * Multiply B,X * A |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
296 MulAxBX pshs x,b,a |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
297 lda $03,s get bits 7-0 of X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
298 mul multiply * b |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
299 pshs b,a store product on stack |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
300 lda $02,s get A on stack |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
301 ldb $04,s and bits 15-8 of X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
302 mul multiply |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
303 pshs b,a store product |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
304 lda $04,s get A on stack |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
305 ldb $07,s and bits 7-0 of X |
115 | 306 bsr L0157 |
307 lda $05,s | |
308 ldb $06,s | |
309 bsr L0157 | |
116 | 310 andcc #^Carry |
115 | 311 ldd $02,s |
312 ldx ,s | |
313 beq L0154 | |
116 | 314 orcc #Carry |
115 | 315 L0154 leas $08,s |
316 rts | |
317 L0157 mul | |
318 addd $03,s | |
319 std $03,s | |
320 bcc L0160 | |
321 inc $02,s | |
322 L0160 rts | |
323 L0161 pshs y,x,b,a | |
324 ldd ,s | |
325 bne L016B | |
116 | 326 orcc #Carry |
115 | 327 bra L018B |
328 L016B ldd #$0010 | |
329 stb $04,s | |
330 clrb | |
331 L0171 lsl $03,s | |
332 rol $02,s | |
333 rolb | |
334 rola | |
335 subd ,s | |
336 bmi L017F | |
337 inc $03,s | |
338 bra L0181 | |
339 L017F addd ,s | |
340 L0181 dec $04,s | |
341 bne L0171 | |
342 tfr d,x | |
343 ldd $02,s | |
116 | 344 andcc #^Carry |
115 | 345 L018B leas $06,s |
346 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
347 |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
348 * Copy from Y to X until byte zero is encountered |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
349 l@ sta ,x+ |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
350 CopyY2X lda ,y+ |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
351 bne l@ |
115 | 352 rts |
722 | 353 |
115 | 354 L0195 pshs u,y |
355 tfr s,u | |
356 bsr L01A7 | |
116 | 357 andcc #^Carry |
115 | 358 puls pc,u,y |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
359 |
115 | 360 L019F tfr u,s |
116 | 361 orcc #Carry |
115 | 362 puls pc,u,y |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
363 |
115 | 364 L01A5 leax $01,x |
365 L01A7 bsr L01C9 | |
366 pshs b,a | |
367 L01AB bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
368 cmpa #'- subtract? |
115 | 369 bne L01B9 |
370 bsr L01C7 | |
371 nega | |
372 negb | |
373 sbca #$00 | |
374 bra L01BF | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
375 L01B9 cmpa #'+ add? |
115 | 376 bne L01C5 |
377 bsr L01C7 | |
378 L01BF addd ,s | |
379 std ,s | |
380 bra L01AB | |
381 L01C5 puls pc,b,a | |
382 L01C7 leax $01,x | |
383 L01C9 bsr L01FD | |
384 pshs b,a | |
385 L01CD bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
386 cmpa #'* multiply? |
115 | 387 bne L01E2 |
388 bsr L01FB | |
389 pshs x | |
390 ldx $02,s | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
391 lbsr MulAxBX |
115 | 392 bcc L01F5 |
722 | 393 ldb #E$MulOvf |
115 | 394 bra L019F |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
395 L01E2 cmpa #'/ divide? |
115 | 396 bne L01C5 |
397 bsr L01FB | |
398 pshs x | |
399 ldx $02,s | |
400 lbsr L0161 | |
401 bcc L01F5 | |
722 | 402 ldb #E$ZerDiv |
115 | 403 bra L019F |
404 L01F5 puls x | |
405 std ,s | |
406 bra L01CD | |
407 L01FB leax $01,x | |
408 L01FD bsr L0222 | |
409 pshs b,a | |
410 L0201 bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
411 cmpa #'& logical and? |
115 | 412 bne L020F |
413 bsr L0220 | |
414 andb $01,s | |
415 anda ,s | |
416 bra L0219 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
417 L020F cmpa #'! logical or? |
115 | 418 bne L01C5 |
419 bsr L0220 | |
420 orb $01,s | |
421 ora ,s | |
422 L0219 std ,s | |
423 bra L0201 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
424 L021D lbra EatSpace |
115 | 425 L0220 leax $01,x |
426 L0222 bsr L021D | |
722 | 427 cmpa #'^ logical not? |
115 | 428 bne L022E |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
429 bsr ParsExp |
722 | 430 comb not B |
431 coma not A | |
115 | 432 bra L0238 |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
433 L022E cmpa #'- negate? |
115 | 434 bne L023B |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
435 bsr ParsExp |
115 | 436 nega |
437 negb | |
438 sbca #$00 | |
439 L0238 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
440 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
441 ParsExp leax $01,x |
115 | 442 L023B bsr L021D |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
443 cmpa #'( open paren? |
115 | 444 bne L0250 |
445 lbsr L01A5 | |
446 pshs b,a | |
447 bsr L021D | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
448 cmpa #') close paren? |
115 | 449 beq L0282 |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
450 ldb #E$RParen |
115 | 451 bra L0265 |
687 | 452 L0250 cmpa #'[ |
115 | 453 bne L026A |
454 lbsr L01A5 | |
455 tfr d,y | |
456 ldd ,y | |
457 pshs b,a | |
458 bsr L021D | |
687 | 459 cmpa #'] |
115 | 460 beq L0282 |
722 | 461 ldb #E$RBrckt |
115 | 462 L0265 leas $02,s |
463 L0267 lbra L019F | |
687 | 464 L026A cmpa #'< |
115 | 465 bne L0286 |
466 lbsr L01A5 | |
467 tfr d,y | |
468 clra | |
469 ldb ,y | |
470 pshs b,a | |
471 bsr L021D | |
687 | 472 cmpa #'> |
115 | 473 beq L0282 |
722 | 474 ldb #E$RABrkt |
115 | 475 bra L0265 |
476 L0282 leax $01,x | |
477 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
|
478 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
479 L0286 cmpa #C$PERD |
115 | 480 bne L028F |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
481 ldd <curraddr |
115 | 482 leax $01,x |
483 rts | |
722 | 484 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
485 L028F cmpa #'' ASCII byte? |
115 | 486 bne L0297 |
487 ldd ,x++ | |
488 clra | |
489 rts | |
722 | 490 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
491 L0297 cmpa #'" ASCII word? |
115 | 492 bne L02A0 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
493 leax $01,x point past quote char |
115 | 494 ldd ,x++ |
495 rts | |
722 | 496 |
687 | 497 L02A0 cmpa #': |
115 | 498 bne L02B4 |
499 leax $01,x | |
722 | 500 bsr GetReg get register that follows : |
501 bcs L0267 branch if error | |
502 tsta is this byte or word register? | |
503 bmi L02B1 branch if word | |
504 clra else clear hi byte | |
505 ldb ,y and get byte at offset | |
115 | 506 rts |
722 | 507 L02B1 ldd ,y get word at offset |
508 L02B3 rts return | |
509 | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
510 L02B4 lbsr EvalSpec evaluate number specifier |
115 | 511 bcc L02B3 |
512 beq L02BF | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
513 ldb #E$OpMsng |
115 | 514 bra L0267 |
722 | 515 L02BF ldb #E$BadCnt |
115 | 516 bra L0267 |
721 | 517 |
518 * Parse individual register | |
519 * Entry: | |
520 * X = address of register to find | |
521 * Exit: | |
522 * A = register offset value in table | |
523 * Y = ptr to register offset in stack | |
524 GetReg ldb #RegEnts get number of register entries | |
115 | 525 pshs b |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
526 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
|
527 cmpd #$7370 sp? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
528 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
|
529 cmpd #$5350 SP? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
530 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
|
531 L02D5 leax $02,x move past two chars |
115 | 532 ldd #$0002 |
533 tfr dp,a | |
534 tfr d,y | |
535 lda #$80 | |
536 bra L0314 | |
721 | 537 L02E2 leay >RegList,pcr |
538 L02E6 lda ,y get first char of register entry | |
539 ldb $01,y get second char of register entry | |
540 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
|
541 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
|
542 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
|
543 adda #$20 make lowercase |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
544 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
|
545 beq L0307 yes, a match |
115 | 546 bra L0318 |
721 | 547 L02F8 cmpd ,x same as user input? |
548 beq L0305 yes, a match | |
549 addd #$2020 make uppercase | |
550 cmpd ,x same as user input? | |
551 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
|
552 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
|
553 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
|
554 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
|
555 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
|
556 andb #$0F mask off hi nibble |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
557 ldy <regstack get stack in Y |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
558 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
|
559 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
|
560 puls pc,b return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
561 |
115 | 562 L0318 leay $03,y |
563 dec ,s | |
564 bne L02E6 | |
116 | 565 orcc #Carry |
115 | 566 puls pc,b |
687 | 567 |
721 | 568 * Register list for 6809/6309 |
569 RegList fcc "CC" | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
570 fcb R$CC |
115 | 571 fcc "DP" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
572 fcb R$DP |
115 | 573 fcc "PC" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
574 fcb $80+R$PC |
115 | 575 fcc "A" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
576 fcb $00,R$A |
115 | 577 fcc "B" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
578 fcb $00,R$B |
115 | 579 fcc "D" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
580 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
|
581 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
582 fcc "E" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
583 fcb $00,R$E |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
584 fcc "F" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
585 fcb $00,R$F |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
586 fcc "W" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
587 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
|
588 ENDC |
115 | 589 fcc "X" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
590 fcb $00,$80+R$X |
115 | 591 fcc "Y" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
592 fcb $00,$80+R$Y |
115 | 593 fcc "U" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
594 fcb $00,$80+R$U |
721 | 595 RegEnts equ (*-RegList)/3 |
115 | 596 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
597 start |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
598 IFEQ SYSDEBUG-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
599 lbsr Init |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
600 ENDC |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
601 leas >size,u point S to end of memory |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
602 leas -R$Size,s back off size of register stack |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
603 sts <regstack save off |
115 | 604 sts <u0004 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
605 leay >DefBrk,pcr |
691 | 606 sty R$PC,s |
607 lda #Entire | |
608 sta R$CC,s | |
609 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
|
610 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
|
611 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
|
612 leax <-UnknSiz,x back off more |
115 | 613 stx <u0008 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
614 leax <-NumBrkPt*3,x |
722 | 615 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
|
616 clr <curraddr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
617 clr <curraddr+1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
618 clr <isnarrow |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
619 IFEQ SYSDEBUG |
711 | 620 pshs y,x,b,a |
621 lda #$01 stdout | |
622 ldb #SS.ScSiz get screen size | |
722 | 623 os9 I$GetStt do it! |
711 | 624 bcc L0380 |
625 cmpb #E$UnkSvc | |
626 beq L0387 | |
627 puls x,y,b,a | |
628 lbra L0735 | |
1791 | 629 L0380 cmpx #51 51 columns? |
630 bge 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
|
631 inc <isnarrow |
711 | 632 L0387 puls x,y,b,a |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
633 ENDC |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
634 |
722 | 635 * Clear breakpoint table |
115 | 636 L036A clr ,x+ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
637 cmpx <buffptr |
115 | 638 bcs L036A |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
639 leax >IcptRtn,pcr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
640 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
|
641 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
|
642 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
|
643 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
|
644 ldx <buffptr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
645 leay >Title,pcr point to title |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
646 * bsr L03C2 print it |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
647 lbsr CopyY2X print it |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
648 lbsr WritLnOut |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
649 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
650 * 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
|
651 GetInput leay >Prompt,pcr point to prompt |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
652 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
|
653 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
|
654 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
|
655 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
|
656 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
|
657 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
|
658 suba #$20 make uppercase |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
659 sta ,x and save |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
660 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
|
661 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
|
662 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
|
663 cmpa ,x same? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
664 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
|
665 * 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
|
666 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
|
667 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
|
668 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
|
669 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
|
670 bra GetInput |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
671 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
672 * Command wasn't recognized |
722 | 673 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
|
674 bsr ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
675 bra GetInput |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
676 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
677 ShowErr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
678 cmpb #E$BadSWI |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
679 bhi ShowErrNum |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
680 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
681 leay ETable,pcr point to error string table |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
682 lslb multiply index by 2 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
683 ldd b,y and get address in X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
684 leay d,y |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
685 ldx <buffptr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
686 lbsr CopyY2X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
687 lbra WritLnErr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
688 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
689 ShowErrNum |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
690 IFEQ SYSDEBUG |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
691 os9 F$PErr |
115 | 692 rts |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
693 ELSE |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
694 pshs b |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
695 leay ErrMsg,pcr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
696 ldx <buffptr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
697 lbsr CopyY2X |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
698 puls b |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
699 lbsr Word2Dec3 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
700 lbra WritLnErr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
701 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
702 ErrMsg fcc /ERROR #/ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
703 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
704 ENDC |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
705 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
706 ETable fdb E0-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
707 fdb E1-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
708 fdb E2-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
709 fdb E3-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
710 fdb E4-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
711 fdb E5-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
712 fdb E6-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
713 fdb E7-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
714 fdb E8-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
715 fdb E9-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
716 fdb E10-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
717 fdb E11-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
718 fdb E12-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
719 fdb E13-ETable |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
720 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
721 E0 fcc "Illegal constant" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
722 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
723 E1 fcc "Divide by zero" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
724 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
725 E2 fcc "Multiply overflow" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
726 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
727 E3 fcc "Illegal operand" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
728 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
729 E4 fcc ") missing" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
730 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
731 E5 fcc "} missing" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
732 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
733 E6 fcc "] missing" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
734 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
735 E7 fcc "Illegal register" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
736 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
737 E8 fcc "Byte overflow" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
738 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
739 E9 fcc "Illegal command" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
740 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
741 E10 fcc "ROM Memory" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
742 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
743 E11 fcc "Breakpoint table full" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
744 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
745 E12 fcc "Breakpoint not found" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
746 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
747 E13 fcc "Illegal SWI" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
748 fcb 0 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
749 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
750 |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
751 *L03C2 lbra CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
752 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
753 * 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
|
754 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
|
755 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
|
756 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
|
757 ldd <prevaddr else get previous address |
115 | 758 bra L03DC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
759 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
|
760 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
|
761 L03D3 ldd <curraddr |
115 | 762 bra L03DC |
763 L03D7 lbsr L0195 | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
764 lbcs ShowErr |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
765 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
|
766 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
|
767 std <curraddr and save D in new memory loc |
115 | 768 pshs b,a |
769 bsr L0415 | |
770 ldd ,s | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
771 lbsr Word2HexSpc |
115 | 772 puls y |
773 ldb ,y | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
774 lbsr Byte2Hex |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
775 lbra WritLnOut |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
776 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
777 * Show previous byte |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
778 PrevByte ldd <curraddr get current memory address |
721 | 779 IFNE H6309 |
780 decd | |
781 ELSE | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
782 subd #$0001 subtract 1 |
721 | 783 ENDC |
115 | 784 bra L03DC |
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 * 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
|
787 SetLoc bsr L043F |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
788 lbcs ShowErr |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
789 ldx <curraddr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
790 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
|
791 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
|
792 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
|
793 ldb #E$NotRAM else load B with error |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
794 lbsr ShowErr and show it |
115 | 795 bra L03D3 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
796 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
797 * Show next byte |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
798 NextByte ldd <curraddr get current memory address |
721 | 799 IFNE H6309 |
800 incd | |
801 ELSE | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
802 addd #$0001 add one to it |
721 | 803 ENDC |
115 | 804 bra L03DC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
805 L0415 ldx <buffptr load X with buffer pointer |
115 | 806 pshs b,a |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
807 leay >Spaces,pcr point to spaces |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
808 * bsr L03C2 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
809 lbsr CopyY2X |
115 | 810 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
|
811 |
722 | 812 * Calc expression |
813 Calc lbsr L0195 | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
814 lbcs ShowErr |
115 | 815 bsr L0415 |
816 pshs b,a | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
817 lda #'$ hex prefix |
115 | 818 sta ,x+ |
819 lda ,s | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
820 lbsr Word2HexSpc |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
821 lda #'# decimal prefix |
115 | 822 sta ,x+ |
823 puls b,a | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
824 lbsr Word2Dec5 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
825 lbra WritLnOut |
115 | 826 L043F lbsr L0195 |
827 bcs L044B | |
828 tsta | |
829 beq L044B | |
722 | 830 ldb #E$BytOvf |
116 | 831 orcc #Carry |
115 | 832 L044B rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
833 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
834 * Show all registers |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
835 ShowRegs lbsr L0512 |
115 | 836 beq L04AF |
721 | 837 lbsr GetReg |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
838 lbcs ShowErr |
721 | 839 pshs y,a save pointer to register and offset |
115 | 840 lbsr L0512 |
841 bne L0475 | |
842 bsr L0415 | |
721 | 843 puls y,a retreive pointer to register and offset |
844 tsta test A | |
845 bpl L046D branch if positive, means one byte3 | |
846 ldd ,y load D with two bytes | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
847 lbsr Word2Hex |
115 | 848 bra L0472 |
721 | 849 L046D ldb ,y load B with one byte |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
850 lbsr Byte2Hex |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
851 L0472 lbra WritLnOut |
115 | 852 L0475 lda ,s+ |
853 bpl L0485 | |
854 lbsr L0195 | |
855 puls y | |
856 lbcs L054E | |
857 std ,y | |
858 rts | |
859 L0485 bsr L043F | |
860 puls y | |
861 lbcs L054E | |
862 stb ,y | |
863 rts | |
687 | 864 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
865 ShrtHdr fcc "PC=" |
115 | 866 fcb $00 |
867 fcc "A=" | |
868 fcb $00 | |
869 fcc "B=" | |
870 fcb $00 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
871 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
872 fcc "E=" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
873 fcb $00 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
874 fcc "F=" |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
875 fcb $00 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
876 ENDC |
115 | 877 fcc "CC=" |
878 fcb $00 | |
879 fcc "DP=" | |
880 fcb $00 | |
881 fcc "SP=" | |
882 fcb $00 | |
883 fcc "X=" | |
884 fcb $00 | |
885 fcc "Y=" | |
886 fcb $00 | |
887 fcc "U=" | |
888 fcb $00 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
889 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
890 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
|
891 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
|
892 pshs u save U |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
893 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
|
894 leay <ShrtHdr,pcr |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
895 ldu <regstack |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
896 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
897 ldd R$PC,u |
720 | 898 IFNE H6309 |
899 lbsr L0505 | |
900 ELSE | |
115 | 901 bsr L0505 |
720 | 902 ENDC |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
903 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
904 ldb R$A,u |
720 | 905 IFNE H6309 |
906 lbsr L050F | |
907 ELSE | |
115 | 908 bsr L050F |
720 | 909 ENDC |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
910 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
911 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
|
912 IFNE H6309 |
98acb7c3a708
Added code to allow printing of registers in 6309 mode on a narrow screen
boisy
parents:
729
diff
changeset
|
913 lbsr L050F |
98acb7c3a708
Added code to allow printing of registers in 6309 mode on a narrow screen
boisy
parents:
729
diff
changeset
|
914 ELSE |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
915 bsr L050F |
735
98acb7c3a708
Added code to allow printing of registers in 6309 mode on a narrow screen
boisy
parents:
729
diff
changeset
|
916 ENDC |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
917 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
918 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
919 ldb R$E,u |
115 | 920 bsr L050F |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
921 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
922 ldb R$F,u |
115 | 923 bsr L050F |
721 | 924 pshs y |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
925 lbsr WritLnOut |
721 | 926 puls y |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
927 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
928 ENDC |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
929 ldb R$CC,u |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
930 bsr L050F |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
931 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
932 ldb R$DP,u |
115 | 933 bsr L050F |
721 | 934 IFEQ H6309 |
115 | 935 pshs y |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
936 lbsr WritLnOut |
115 | 937 puls y |
721 | 938 ENDC |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
939 lbsr CopyY2X |
115 | 940 tfr u,d |
941 bsr L0505 | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
942 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
943 ldd R$X,u |
115 | 944 bsr L0505 |
735
98acb7c3a708
Added code to allow printing of registers in 6309 mode on a narrow screen
boisy
parents:
729
diff
changeset
|
945 IFNE H6309 |
98acb7c3a708
Added code to allow printing of registers in 6309 mode on a narrow screen
boisy
parents:
729
diff
changeset
|
946 pshs y |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
947 lbsr WritLnOut |
735
98acb7c3a708
Added code to allow printing of registers in 6309 mode on a narrow screen
boisy
parents:
729
diff
changeset
|
948 puls y |
98acb7c3a708
Added code to allow printing of registers in 6309 mode on a narrow screen
boisy
parents:
729
diff
changeset
|
949 ENDC |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
950 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
951 ldd R$Y,u |
115 | 952 bsr L0505 |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
953 lbsr CopyY2X |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
954 ldd R$U,u |
115 | 955 bsr L0505 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
956 lbsr WritLnOut |
115 | 957 puls pc,u |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
958 * 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
|
959 WidRegs lbsr L0415 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
960 leay >RegHdr,pcr |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
961 lbsr CopyY2X |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
962 lbsr WritLnOut |
711 | 963 lbsr L0415 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
964 ldd <regstack |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
965 bsr L0505 show SP |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
966 ldy <regstack |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
967 bsr L050D show CC |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
968 bsr L050D show A |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
969 bsr L050D show B |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
970 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
971 bsr L050D show E |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
972 bsr L050D show F |
711 | 973 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
974 bsr L050D show DP |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
975 bsr L0550 show X |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
976 bsr L0550 show Y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
977 bsr L0550 show U |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
978 bsr L0550 show PC |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
979 lbra WritLnOut |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
980 |
711 | 981 L0550 ldd ,y++ |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
982 L0505 lbra Word2HexSpc |
115 | 983 L0508 ldd ,y++ |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
984 lbra Word2Hex |
711 | 985 L050D ldb ,y+ |
115 | 986 L050F lbra L0017 |
719
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 * 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
|
989 L0512 lbsr EatSpace |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
990 cmpa #C$CR |
115 | 991 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
992 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
993 * Set/show breakpoints |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
994 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
|
995 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
|
996 * Here we show all breakpoints |
115 | 997 lbsr L0415 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
998 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
|
999 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
|
1000 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
|
1001 L0526 ldd ,y empty? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1002 beq L052D branch if so |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1003 lbsr Word2HexSpc else show breakpoint at Y |
115 | 1004 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
|
1005 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
|
1006 bne L0526 continue searching |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1007 leas $01,s kill byte on stack |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1008 lbra WritLnOut |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1009 * Set breakpoint here |
115 | 1010 L0538 lbsr L0195 |
1011 bcs L054E | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1012 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
|
1013 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
|
1014 beq L0551 if duplicate, just exit |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1015 IFNE H6309 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1016 clrd else load D with empty address |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1017 ELSE |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1018 ldd #$0000 else load D with empty address |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1019 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1020 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
|
1021 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
|
1022 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
|
1023 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
|
1024 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
|
1025 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
|
1026 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
|
1027 rts then return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1028 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1029 * 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
|
1030 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
|
1031 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
|
1032 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
|
1033 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
|
1034 L055F cmpu ,y match? |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1035 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
|
1036 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
|
1037 decb dec couner |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1038 bne L055F if not 0, continue search |
722 | 1039 ldb #E$NoBkPt |
116 | 1040 andcc #^Zero |
115 | 1041 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
|
1042 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1043 * Kill breakpoint(s) |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1044 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
|
1045 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
|
1046 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
|
1047 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
|
1048 bsr SrchBkpt |
115 | 1049 bne L054E |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1050 IFNE H6309 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1051 clrd |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1052 ELSE |
115 | 1053 clra |
1054 clrb | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1055 ENDC |
115 | 1056 std ,y |
1057 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1058 * Kill all breakpoints |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1059 KillAll ldy <bptable |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1060 ldb #NumBrkPt*3 |
115 | 1061 L0586 clr ,y+ |
1062 decb | |
1063 bne L0586 | |
1064 rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1065 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1066 * Go at address |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1067 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
|
1068 beq L059A branch if none |
115 | 1069 lbsr L0195 |
1070 bcs L054E | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1071 ldy <regstack get execution stack |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1072 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
|
1073 * 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
|
1074 L059A ldy <bptable |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1075 ldb #R$Size get register size |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1076 ldx <regstack point to registers |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1077 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
|
1078 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
|
1079 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
|
1080 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
|
1081 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
|
1082 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
|
1083 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
|
1084 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
|
1085 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
|
1086 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
|
1087 decb decrement |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1088 bne L05A3 branch if not complete |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1089 lds <regstack get execution stack |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1090 rti run program |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1091 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1092 MemDump bsr L0613 |
115 | 1093 bcs L054E |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1094 tst <isnarrow |
711 | 1095 bne L0615 |
1096 orb #$0F | |
1097 bra L0617 | |
1098 L0615 orb #$07 | |
1099 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
|
1100 tst <isnarrow |
711 | 1101 bne L0621 |
1102 andb #$F0 | |
1103 bra L0623 | |
1104 L0621 andb #$F8 | |
1105 L0623 pshs u,b,a | |
115 | 1106 cmpd $02,s |
1107 bcc L05D9 | |
1108 L05CD ldy ,s | |
1109 leay -$01,y | |
1110 cmpy $02,s | |
1111 leay $01,y | |
1112 bcs L05DB | |
1113 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
|
1114 L05DB ldx <buffptr |
115 | 1115 tfr y,d |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1116 lbsr Word2HexSpc |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1117 tst <isnarrow |
711 | 1118 bne L0647 |
722 | 1119 ldb #8 |
711 | 1120 bra L0649 |
722 | 1121 L0647 ldb #4 |
711 | 1122 L0649 pshs b |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1123 L05E6 tst <isnarrow |
711 | 1124 bne L0654 |
1125 lbsr L0550 | |
1126 bra L0657 | |
1127 L0654 lbsr L0508 | |
1128 L0657 dec ,s | |
115 | 1129 bne L05E6 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1130 tst <isnarrow |
711 | 1131 bne L0663 |
722 | 1132 ldb #16 |
711 | 1133 bra L0668 |
1134 L0663 lbsr L0019 | |
722 | 1135 ldb #8 |
711 | 1136 L0668 stb ,s |
115 | 1137 ldy $01,s |
1138 L05F7 lda ,y+ | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1139 cmpa #'~ |
115 | 1140 bhi L0601 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1141 cmpa #C$SPAC |
115 | 1142 bcc L0603 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1143 L0601 lda #'. |
115 | 1144 L0603 sta ,x+ |
1145 dec ,s | |
1146 bne L05F7 | |
1147 leas $01,s | |
1148 sty ,s | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1149 lbsr WritLnOut |
115 | 1150 bra L05CD |
1151 L0613 lbsr L0195 | |
1152 bcs L061D | |
1153 tfr d,u | |
1154 lbsr L0195 | |
1155 L061D rts | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1156 |
722 | 1157 ClearMem bsr L0613 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1158 lbcs ShowErr |
722 | 1159 pshs b,a save fill word |
115 | 1160 L0626 cmpu ,s |
1161 bls L062D | |
1162 puls pc,b,a | |
1163 L062D ldd #$8008 | |
1164 sta ,u | |
1165 L0632 cmpa ,u | |
1166 bne L063E | |
1167 lsra | |
1168 lsr ,u | |
1169 decb | |
1170 bne L0632 | |
1171 bra L064E | |
1172 L063E lbsr L0415 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1173 ldd #$2D20 dash, space |
115 | 1174 std ,x++ |
1175 tfr u,d | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1176 lbsr Word2Hex |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1177 lbsr WritLnOut |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1178 L064E leau 1,u |
115 | 1179 bra L0626 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1180 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1181 * Intercept routine |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1182 IcptRtn equ * |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1183 IFNE H6309 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1184 tfr 0,dp |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1185 ELSE |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1186 clra |
115 | 1187 tfr a,dp |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1188 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1189 IFEQ Level-1 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1190 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
|
1191 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
|
1192 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
|
1193 ENDC |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1194 sts <regstack |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1195 ldd R$PC,s |
721 | 1196 IFNE H6309 |
1197 decd | |
1198 ELSE | |
115 | 1199 subd #$0001 |
721 | 1200 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1201 std R$PC,s |
115 | 1202 lds <u0004 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1203 lbsr SrchBkpt |
115 | 1204 beq L0672 |
722 | 1205 ldb #E$BadSWI |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1206 lbsr ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1207 * Clear breakpoints in memory |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1208 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
|
1209 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
|
1210 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
|
1211 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
|
1212 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
|
1213 sta ,x restore it |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1214 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
|
1215 decb dec counter |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1216 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
|
1217 lbsr WritCR |
115 | 1218 lbsr L0415 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1219 leay >BkPtHdr,pcr |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1220 lbsr CopyY2X |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1221 lbsr WritLnOut |
115 | 1222 lbsr L04AF |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1223 lbra GetInput |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1224 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1225 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
|
1226 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
|
1227 ldx <buffptr |
115 | 1228 tfr u,d |
1229 pshs u | |
1230 lbsr L03DC | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1231 lbsr WritLnOut |
115 | 1232 puls u |
1233 bra L06CC | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1234 |
721 | 1235 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
|
1236 * lda #$00 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1237 clra |
721 | 1238 os9 F$Link link to module name at X |
115 | 1239 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1240 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1241 * Prepare module for execution |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1242 PrepMod bsr LinkIt |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1243 lbcs ShowErr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1244 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
|
1245 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
|
1246 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
|
1247 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
|
1248 lbsr ShowErr show error |
711 | 1249 L06CC equ * |
1250 IFEQ Level-1 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1251 os9 F$UnLink |
711 | 1252 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1253 rts and return |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1254 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1255 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
|
1256 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
|
1257 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
|
1258 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
|
1259 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
|
1260 clrb start at zero |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1261 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
|
1262 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
|
1263 incb continue |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1264 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
|
1265 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
|
1266 sty -R$U,y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1267 leay -R$Size,y |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1268 sty <regstack |
115 | 1269 clra |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1270 std R$A,y |
115 | 1271 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
|
1272 stx R$Y,y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1273 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
|
1274 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
|
1275 stx R$PC,y save at PC |
115 | 1276 tfr cc,a |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1277 ora #Entire |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1278 sta R$CC,y |
115 | 1279 tfr dp,a |
1280 adda #$02 | |
1281 clrb | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1282 std R$U,y |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1283 sta R$DP,y |
115 | 1284 lbra L04AF |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1285 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1286 * 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
|
1287 ForkPrg lbsr EatSpace skip leading spaces |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1288 IFNE H6309 |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1289 clrd |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1290 ELSE |
115 | 1291 clra |
1292 clrb | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1293 ENDC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1294 tfr x,u move param ptr to U |
115 | 1295 tfr d,y |
1296 L0715 leay $01,y | |
1297 lda ,x+ | |
687 | 1298 cmpa #C$CR |
115 | 1299 bne L0715 |
1300 clra | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1301 leax <ShellNam,pcr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1302 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
|
1303 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
|
1304 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
|
1305 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
|
1306 rts and return |
687 | 1307 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1308 ShellNam fcc "shell" |
687 | 1309 fcb $00 |
1310 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1311 * Exit without error |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1312 ExitOk clrb |
711 | 1313 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
|
1314 |
722 | 1315 * Search for byte or word from . to end address |
1316 * Syntax: S endaddr byte | |
1317 * S endaddr word | |
1318 SrchMem lbsr L0613 | |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1319 lbcs ShowErr |
115 | 1320 pshs u |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1321 ldx <curraddr |
722 | 1322 tsta byte or word? |
1323 bne L0750 branch if word | |
1324 L0746 cmpb ,x+ byte in B match byte at ,X? | |
1325 beq L075C branch if so | |
1326 cmpx ,s is X equal to end? | |
1327 bne L0746 branch if not | |
1328 puls pc,u else we're done | |
1329 L0750 cmpd ,x+ byte in B match byte at ,X? | |
1330 beq L075C branch if so | |
115 | 1331 cmpx ,s |
722 | 1332 bne L0750 branch if not |
115 | 1333 puls pc,u |
722 | 1334 L075C leax -$01,x back up to mem location found |
1335 tfr x,d put memory location in D | |
1336 leas $02,s wipe out stack | |
115 | 1337 lbra L03DC |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1338 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1339 DefBrk swi |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1340 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1341 Title fcc "Interactive " |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1342 IFEQ SYSDEBUG-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1343 fcc "System " |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1344 ENDC |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1345 fcc "Debugger" |
115 | 1346 fcb $00 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1347 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1348 Prompt |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1349 IFEQ SYSDEBUG-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1350 fcc "S" |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1351 ENDC |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1352 fcc "DB: " |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1353 fcb $00 |
721 | 1354 Spaces fcc " " |
115 | 1355 fcb $00 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1356 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1357 IFNE H6309 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1358 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
|
1359 ELSE |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1360 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
|
1361 ENDC |
115 | 1362 fcb $00 |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1363 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1364 BkPtHdr fcc "BKPT" |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1365 CmdTbl fcc ": " |
115 | 1366 fcb $00 |
687 | 1367 fcc /./ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1368 fdb DotCmd |
687 | 1369 fcc /=/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1370 fdb SetLoc |
687 | 1371 fcb C$CR |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1372 fdb NextByte |
687 | 1373 fcb C$SPAC |
722 | 1374 fdb Calc |
687 | 1375 fcc /-/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1376 fdb PrevByte |
687 | 1377 fcc /:/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1378 fdb ShowRegs |
687 | 1379 fcc /K/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1380 fdb KillBkpt |
687 | 1381 fcc /M/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1382 fdb MemDump |
687 | 1383 fcc /C/ |
722 | 1384 fdb ClearMem |
687 | 1385 fcc /B/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1386 fdb SetBkpt |
687 | 1387 fcc /G/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1388 fdb GoPC |
687 | 1389 fcc /L/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1390 fdb LinkMod |
687 | 1391 fcc /E/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1392 fdb PrepMod |
687 | 1393 fcc /$/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1394 fdb ForkPrg |
687 | 1395 fcc /Q/ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1396 fdb ExitOk |
687 | 1397 fcc /S/ |
722 | 1398 fdb SrchMem |
115 | 1399 fcb $00 |
687 | 1400 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1401 ******** INPUT/OUTPUT ROUTINES ******** |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1402 * |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1403 * WritCR - Write CR to stdout |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1404 WritCR ldx <buffptr |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1405 * Append CR to <buffptr and write to stdout |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1406 WritLnOut |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1407 bsr cr@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1408 bra llwout |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1409 WritLnErr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1410 bsr cr@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1411 bra llwerr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1412 cr@ lda #C$CR |
687 | 1413 sta ,x+ |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1414 ldx <buffptr |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1415 ldy #81 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1416 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1417 |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1418 PrintY tfr y,x |
115 | 1419 tfr y,u |
1420 ldy #$0000 | |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1421 PrintYL ldb ,u+ get next char |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1422 beq llwout write it |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1423 leay $01,y increase Y |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1424 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
|
1425 |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1426 IFEQ SYSDEBUG |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1427 llwerr lda #$02 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1428 fcb $8C |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1429 * Write To Standard Output |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1430 * Entry: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1431 * X = address of buffer to write |
729
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1432 * Exit: |
29036be0e9d8
Bumped to edition 10, made minor optimizations, needs testing
boisy
parents:
722
diff
changeset
|
1433 * X = address of program's buffptr |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1434 llwout lda #$01 stdout |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1435 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
|
1436 ldx <buffptr |
115 | 1437 rts |
719
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1438 |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1439 * 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
|
1440 * Exit: |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1441 * 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
|
1442 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
|
1443 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
|
1444 clra from stdin |
ff559935b40a
Major changes, incorporated ed #9 from Level Two to OS-9 Level One, added
boisy
parents:
711
diff
changeset
|
1445 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
|
1446 ldx <buffptr reload X with line |
115 | 1447 rts |
1448 | |
1616
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1449 ELSE |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1450 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1451 * 6551 Parameters |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1452 ADDR equ $FF68 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1453 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1454 A_RXD equ ADDR+$00 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1455 A_TXD equ ADDR+$00 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1456 A_STATUS equ ADDR+$01 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1457 A_RESET equ ADDR+$01 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1458 A_CMD equ ADDR+$02 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1459 A_CTRL equ ADDR+$03 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1460 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1461 * Baud rates |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1462 _B2400 equ $1A 2400 bps, 8-N-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1463 _B4800 equ $1C 4800 bps, 8-N-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1464 _B9600 equ $1E 9600 bps, 8-N-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1465 _B19200 equ $1F 19200 bps, 8-N-1 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1466 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1467 BAUD equ _B9600 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1468 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1469 * Init - Initialize |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1470 * Exit: Carry = 0: Init success; Carry = 1; Init failed |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1471 Init |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1472 sta A_RESET soft reset (value not important) |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1473 * Set specific modes and functions: |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1474 * - no parity, no echo, no Tx interrupt |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1475 * no Rx interrupt, enable Tx/Rx |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1476 lda #$0B |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1477 sta A_CMD save to command register |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1478 lda #BAUD |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1479 sta A_CTRL select proper baud rate |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1480 * Read any junk rx byte that may be in the register |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1481 lda A_RXD |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1482 rts |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1483 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1484 * Read - Read one character |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1485 * Exit: A = character that was read |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1486 Read |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1487 r@ lda A_STATUS get status byte |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1488 anda #$08 mask rx buffer status flag |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1489 beq r@ loop if rx buffer empty |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1490 lda A_RXD get byte from ACIA data port |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1491 rts |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1492 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1493 * Write - Write one character |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1494 * Entry: A = character to write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1495 Write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1496 pshs a save byte to write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1497 w@ lda A_STATUS get status byte |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1498 anda #$10 mask tx buffer status flag |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1499 beq w@ loop if tx buffer full |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1500 puls a get byte |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1501 sta A_TXD save to ACIA data port |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1502 rts |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1503 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1504 * Term - Terminate |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1505 Term |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1506 rts |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1507 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1508 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1509 * llwout - Write an entire string |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1510 * llwerr - Write an entire string |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1511 llwerr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1512 llwout |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1513 pshs a |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1514 l@ lda ,x+ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1515 cmpa #C$CR |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1516 beq e@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1517 leay -1,y |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1518 beq f@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1519 bsr Write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1520 bra l@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1521 e@ bsr Write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1522 lda #C$LF |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1523 bsr Write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1524 f@ ldx <buffptr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1525 clrb |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1526 puls a,pc |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1527 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1528 * ReadLine - Read an entire string, up to CR |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1529 * Entry: X = address to place string being read (CR terminated) |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1530 * Y = maximum number of bytes to read (including nul byte) |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1531 ReadLine |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1532 ldx <buffptr |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1533 pshs y,x,a |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1534 ldy #80 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1535 l@ bsr Read read 1 character |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1536 cmpa #C$CR carriage return? |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1537 beq e@ branch if so... |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1538 cmpa #$08 backspace? |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1539 beq bs@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1540 cmpy #$0000 anymore room? |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1541 beq l@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1542 leay -1,y back up one char |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1543 sta ,x+ and save in input buffer |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1544 m@ bsr Write echo back out |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1545 bra l@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1546 e@ sta ,x |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1547 bsr Write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1548 lda #C$LF |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1549 bsr Write |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1550 clrb |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1551 puls a,x,y,pc |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1552 bs@ cmpx 1,s are we at start |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1553 beq l@ if so, do nothing |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1554 clr ,-x else erase last byte |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1555 lbsr Write write backspace |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1556 lda #C$SPAC a space... |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1557 lbsr Write write it |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1558 leay 1,y count back up free char |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1559 lda #$08 another backspace |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1560 bra m@ |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1561 |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1562 ENDC |
04bd37a4ba38
Added newer english language error messages; added code to talk directly to
boisy
parents:
1325
diff
changeset
|
1563 |
115 | 1564 emod |
1565 eom equ * | |
1566 end |