annotate level1/cmds/debug.asm @ 2798:b70d93f8d7ce lwtools-port

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