annotate level1/cmds/debug.asm @ 722:edea65d8200b

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