comparison level1/cmds/asm.asm @ 537:765ff88d3db7

6309 assembler from Curtis Boyle
author boisy
date Sun, 13 Oct 2002 21:37:16 +0000
parents 7dea3d77ba0b
children 5d025106d1ea
comparison
equal deleted inserted replaced
536:631cd5e95ee7 537:765ff88d3db7
1 ******************************************************************** 1 ********************************************************************
2 * Asm - 6809 Assembler 2 * Asm - 6809/6309 Assembler
3 *
4 * ASM V1.6 - Microware version - 6309 instruction assembly by
5 * L. Curtis Boyle
6 *
7 * Obtained by Boisy Pitre from L. Curits Boyle on 10/12/2002
3 * 8 *
4 * $Id$ 9 * $Id$
5 * 10 *
6 * Ed. Comments Who YY/MM/DD 11 * Ed. Comments Who YY/MM/DD
7 * ------------------------------------------------------------------ 12 * ------------------------------------------------------------------
8 * 5 From Tandy OS-9 Level One VR 02.00.00
9 * 6 Made compliant with 1900-2155 BGP 99/05/11 13 * 6 Made compliant with 1900-2155 BGP 99/05/11
10 14
11 nam Asm 15 nam Asm
12 ttl 6809 Assembler 16 ttl 6809/6309 Assembler
13
14 * Disassembled 99/04/12 09:16:34 by Disasm v1.6 (C) 1988 by RML
15 17
16 ifp1 18 ifp1
17 use defsfile 19 use defsfile
18 endc 20 endc
19 21
20 tylg set Prgrm+Objct 22 tylg set Prgrm+Objct
21 atrv set ReEnt+rev 23 atrv set ReEnt+rev
22 rev set $01 24 rev set $02
23 edition set 6 25 edition set $06
24 26
25 mod eom,name,tylg,atrv,start,size 27 mod eom,name,tylg,atrv,asm,size
26 28
27 u0000 rmb 1 29 * u002B Bit flag meanings: (Default=00110101)
28 u0001 rmb 1 30 LitLine equ %10000000 Literal line to print
31 Comment equ %01000000 Comment field present in source line
32 Operand equ %00100000 Operand field present in source line
33 Command equ %00010000 Mnemonic command present in source line
34 Label equ %00001000 Label field present in source line
35 NoObjct equ %00000100 No object code to print
36 PrintPC equ %00000001 Print PC flag
37 DoNothng equ %00000000 Do nothing (no flags set)
38
39 Numop equ 148 # of opcodes in table (including pseudo-ops)
40
41 u0000 rmb 2 Ptr to start of current source line
29 u0002 rmb 1 42 u0002 rmb 1
30 u0003 rmb 1 43 u0003 rmb 1
31 u0004 rmb 1 44 u0004 rmb 1
32 u0005 rmb 1 45 u0005 rmb 1
33 u0006 rmb 1 46 u0006 rmb 1
43 u0010 rmb 2 56 u0010 rmb 2
44 u0012 rmb 2 57 u0012 rmb 2
45 u0014 rmb 2 58 u0014 rmb 2
46 u0016 rmb 1 59 u0016 rmb 1
47 u0017 rmb 1 60 u0017 rmb 1
48 u0018 rmb 1 61 u0018 rmb 1 Path number to source file
49 u0019 rmb 1 62 u0019 rmb 1
50 u001A rmb 1 63 u001A rmb 1 Some output path number
51 u001B rmb 2 64 u001B rmb 2
52 u001D rmb 1 65 u001D rmb 1
53 u001E rmb 1 66 u001E rmb 1
54 u001F rmb 1 67 u001F rmb 1
55 u0020 rmb 1 68 u0020 rmb 1
61 u0026 rmb 1 74 u0026 rmb 1
62 u0027 rmb 1 75 u0027 rmb 1
63 u0028 rmb 1 76 u0028 rmb 1
64 u0029 rmb 1 77 u0029 rmb 1
65 u002A rmb 1 78 u002A rmb 1
66 u002B rmb 1 79 u002B rmb 1 Bit flags
67 u002C rmb 1 80 u002C rmb 1
68 u002D rmb 1 81 u002D rmb 1
69 u002E rmb 1 82 u002E rmb 1
70 u002F rmb 1 83 u002F rmb 2 Ptr to start of current mnemonic
71 u0030 rmb 1 84 u0031 rmb 2 Ptr to next field (or operand start)
72 u0031 rmb 1
73 u0032 rmb 1
74 u0033 rmb 1 85 u0033 rmb 1
75 u0034 rmb 1 86 u0034 rmb 1
76 u0035 rmb 1 87 u0035 rmb 1
77 u0036 rmb 1 88 u0036 rmb 1 Page height (default=66)
78 u0037 rmb 1 89 u0037 rmb 1 Page width (default=80)
79 u0038 rmb 1 90 u0038 rmb 1
80 u0039 rmb 1 91 u0039 rmb 1
81 u003A rmb 1 92 u003A rmb 1
82 u003B rmb 1 93 u003B rmb 1
83 u003C rmb 1 94 u003C rmb 1
88 u0041 rmb 1 99 u0041 rmb 1
89 u0042 rmb 1 100 u0042 rmb 1
90 u0043 rmb 1 101 u0043 rmb 1
91 u0044 rmb 1 102 u0044 rmb 1
92 u0045 rmb 1 103 u0045 rmb 1
93 u0046 rmb 1 104 u0046 rmb 1 # bytes in current instruction
94 u0047 rmb 2 105 u0047 rmb 1 Current instructions flags/index handler byte
106 u0048 rmb 1
95 u0049 rmb 1 107 u0049 rmb 1
96 u004A rmb 1 108 u004A rmb 1 MSB of 16 bit # (for addresses & offsets)
97 u004B rmb 1 109 u004B rmb 1 LSB of 16 bit #
98 u004C rmb 1 110 u004C rmb 1 Flag for DP($ff), Extended($01) or other($00) modes
99 u004D rmb 1 111 u004D rmb 1 Indirect mode flag (0=no, >0=Yes)
100 u004E rmb 1 112 u004E rmb 1 Indexed mode calc completed flag (0=no)
101 u004F rmb 1 113 u004F rmb 1
102 u0050 rmb 1 114 u0050 rmb 1
103 u0051 rmb 1 115 u0051 rmb 1
104 u0052 rmb 1 116 u0052 rmb 1
105 u0053 rmb 1 117 u0053 rmb 1
114 u005C rmb 1 126 u005C rmb 1
115 u005D rmb 1 127 u005D rmb 1
116 u005E rmb 1 128 u005E rmb 1
117 u005F rmb 1 129 u005F rmb 1
118 u0060 rmb 1 130 u0060 rmb 1
119 u0061 rmb 1 131 * The currently assembled instruction goes here
120 u0062 rmb 1 132 u0061 rmb 1 Current instruction's pre-byte (see u0046)
121 u0063 rmb 1 133 u0062 rmb 1 Current instruction's opcode
134 u0063 rmb 1 More bytes as needed by instruction
122 u0064 rmb 1 135 u0064 rmb 1
123 u0065 rmb 4 136 u0065 rmb 4
124 u0069 rmb 1 137 u0069 rmb 1
125 u006A rmb 3 138 u006A rmb 3
126 u006D rmb 2 139 u006D rmb 2
155 u00CF rmb 8 168 u00CF rmb 8
156 u00D7 rmb 10 169 u00D7 rmb 10
157 u00E1 rmb 7 170 u00E1 rmb 7
158 u00E8 rmb 4 171 u00E8 rmb 4
159 u00EC rmb 12 172 u00EC rmb 12
160 u00F8 rmb 3848 173 u00F8 rmb 3848 Main buffer area
161 size equ . 174 size equ .
162 175 name equ *
163 name fcs /Asm/ 176 fcs /Asm/
164 fcb edition 177 fcb edition
165 178 asm tfr u,d
166 start equ *
167 tfr u,d
168 addd #$01C0 179 addd #$01C0
169 std <u0014 180 std <u0014
170 std <u0016 181 std <u0016
171 addd #$0009 182 addd #$0009
172 std <u0000 183 std <u0000 Start of current line in source ($1C9)
173 addd #$0051 184 addd #$0051
174 std <u0002 185 std <u0002
175 addd #$0085 186 addd #$0085
176 std <u0004 187 std <u0004
177 addd #$0092 188 addd #$0092
180 std <u0008 191 std <u0008
181 addd #$0050 192 addd #$0050
182 std <u000A 193 std <u000A
183 addd #$0028 194 addd #$0028
184 std <u000E 195 std <u000E
185 addd #$0100 196 adda #$01
186 std <u0010 197 std <u0010
187 addd #$0034 198 addd #$0034
188 std <u001D 199 std <u001D
189 leau -$01,y 200 leau -$01,y
190 stu <u0012 201 stu <u0012
205 sta <u0019 216 sta <u0019
206 stb <u001A 217 stb <u001A
207 ldb #$FF 218 ldb #$FF
208 stb <u0056 219 stb <u0056
209 sta <u0057 220 sta <u0057
210 ldb #$42 221 ldb #66 Default page height
211 stb <u0036 222 stb <u0036
212 ldb #$50 223 ldb #80 Default page width
213 stb <u0037 224 stb <u0037
214 lbsr L1696 225 lbsr L1696
215 lda <u0056 226 lda <u0056
216 bmi L0081 227 bmi L0081
217 inc <u0057 228 inc <u0057
258 lbsr L141A 269 lbsr L141A
259 rts 270 rts
260 L00D5 clra 271 L00D5 clra
261 clrb 272 clrb
262 std <u004A 273 std <u004A
263 std <u0061 274 std <u0061 Clear prefix opcode & opcode bytes
264 std <u0063 275 std <u0063
265 sta <u0065 276 sta <u0065
266 sta <u0046 277 sta <u0046 Clear # bytes for current instruction
267 sta <u002A 278 sta <u002A
268 sta <u0021 279 sta <u0021
269 sta <u004C 280 sta <u004C Default memory addressing mode to indexed
270 sta <u002C 281 sta <u002C
271 sta <u004F 282 sta <u004F
272 sta <u004E 283 sta <u004E
273 sta <u004D 284 sta <u004D
274 lda #$35 285 lda #Operand+Command+NoObjct+PrintPC
275 sta <u002B 286 sta <u002B Initialize flags
276 ldd <u0040 287 ldd <u0040
277 std <u0044 288 std <u0044
278 ldx <u0000 289 * Parse for label field
279 lda ,x 290 ldx <u0000 Get ptr to start of line
280 cmpa #$0D 291 lda ,x Get char
281 beq L0136 292 cmpa #$0D Blank line?
282 cmpa #$2A 293 beq L0136 Yes, go ahead
283 beq L0136 294 cmpa #'* Comment line?
284 cmpa #$20 295 beq L0136 Ditto
285 beq L0125 296 cmpa #$20 Space? (No label field)
286 ldb <u002B 297 beq L0125 Yes, go somewhere else
287 orb #$08 298 * Label field found
299 ldb <u002B Set Label Present flag
300 orb #Label
288 stb <u002B 301 stb <u002B
289 lbsr L0368 302 lbsr L0368
290 bcc L0119 303 bcc L0119
291 ldb #$01 304 ldb #$01
292 lbsr L02FA 305 lbsr L02FA
294 L0119 tst <u0054 307 L0119 tst <u0054
295 bne L0125 308 bne L0125
296 lbsr L0F4A 309 lbsr L0F4A
297 bcc L0125 310 bcc L0125
298 lbsr L02FA 311 lbsr L02FA
299 L0125 lbsr L1164 312 * Check for mnemonic field
300 cmpa #$0D 313 L0125 lbsr L1164 Find start of next field & get first char
301 bne L0141 314 cmpa #$0D End of line yet?
302 lda <u002B 315 bne L0141 No, have ptr to mnemonic field
303 bita #$08 316 lda <u002B Get flags
304 beq L0136 317 bita #Label Was a label present?
305 lda #$09 318 beq L0136 No, print whole source line as literal comment
306 bra L0138 319 lda #Label+PrintPC Set Label & Print PC flags (label on line by
307 L0136 lda #$80 320 bra L0138 itself)
308 L0138 sta <u002B 321
322 L0136 lda #LitLine Whole line is comment flag
323 L0138 sta <u002B Save flags
309 lda <u0054 324 lda <u0054
310 bne L018E 325 bne L018E
311 lbra L01F2 326 lbra L01F2
312 L0141 stx <u002F 327 * Process mnemonic field
313 L0143 lda ,x+ 328 L0141 stx <u002F Save ptr to start of current mnemonic
314 cmpa #$0D 329 L0143 lda ,x+ Get char
315 beq L0150 330 cmpa #$0D CR?
316 cmpa #$20 331 beq L0150 Yes, done line
317 bne L0143 332 cmpa #$20 Space?
318 lbsr L1164 333 bne L0143 No, continue getting chars
319 L0150 stx <u0031 334 lbsr L1164 Find start of next field
320 ldx <u002F 335 L0150 stx <u0031 Save ptr to possible operand field
321 ldb #$74 336 ldx <u002F Pointer to start of current op. in source code
322 leay >L03B8,pcr 337 ldb #Numop # of instructions in main table
323 lbsr L0344 338 leay >L03B8,pc Point to main opcode/pseudo-op table
324 bcc L0172 339 lbsr L0344 Go point to it's opcode/flag bytes
325 L015F ldb #$02 340 bcc L0172 Legal opcode, go process
326 lbsr L02FA 341 * Unknown mnemonic
327 ldb #$03 342 L015F ldb #$02 Internal error #?
343 lbsr L02FA Print error message
344 ldb #$03 Set # bytes of current instruction to 3???
328 stb <u0046 345 stb <u0046
329 lda <u002B 346 lda <u002B
330 anda #$DF 347 anda #^Operand Shut off operand present flag
331 sta <u002B 348 sta <u002B
332 ldx <u0031 349 ldx <u0031 Get ptr to next field & skip ahead
333 bra L01C4 350 bra L01C4
334 L0172 lda <u0054 351 * Found mnemonic
335 beq L0195 352 * Entry: Y=Ptr to opcode/flag bytes
336 ldb $01,y 353 L0172 lda <u0054 # of nested loop/if constructs???
337 andb #$0F 354 beq L0195 If none, skip ahead???
338 cmpb #$0D 355 ldb $01,y Get flag bytes
339 bne L0181 356 andb #%00001111 Only want index handler #
340 inca 357 cmpb #$0D Pseudo op IFxx?
341 bra L018C 358 bne L0181 No, check next
342 L0181 cmpb #$0E 359 inca Inc nested loop counter?
343 bne L018E 360 bra L018C Go save it & continue
344 deca 361 L0181 cmpb #$0E Pseudo Op ELSE/ENDC?
345 beq L0195 362 bne L018E No, check next
346 ldb ,y 363 deca Dec nested loop counter?
347 bne L018E 364 beq L0195 If down to zero, skip ahead
348 L018C sta <u0054 365 ldb ,y Get opcode byte
349 L018E inc <u0039 366 bne L018E If ELSE, skip ahead
367 L018C sta <u0054 Save updated nested loop counter?
368 L018E inc <u0039 ???
350 bne L0194 369 bne L0194
351 inc <u0038 370 inc <u0038
352 L0194 rts 371 L0194 rts
353 L0195 ldd ,y 372
354 sta <u0062 373 * Calculate pre-bytes if needed (or known yet in 6309's case)
355 stb <u0047 374 L0195 ldd ,y Get opcode/flag bytes
356 lda #$10 375 sta <u0062 Save opcode
357 bitb #$10 376 stb <u0047 Save flags/index handler nibbles
358 bne L01A7 377 lda #$10 Preload $10 prefix
359 lda #$11 378 bitb #$10 Does this opcode require it?
360 bitb #$20 379 bne L01A7 Yes, go store before normal opcode byte
361 beq L01AB 380 lda #$11 Preload $11 prefix
362 L01A7 sta <u0061 381 bitb #$20 Does this opcode require it?
363 inc <u0046 382 beq L01AB No prefix needed, skip ahead
364 L01AB leay >L0780,pcr 383 L01A7 sta <u0061 Save prebyte
365 andb #$0F 384 inc <u0046 Increase byte count of current instruction
366 lslb 385
367 ldd b,y 386 * Call proper index handler
368 jsr d,y 387 L01AB leay >L0780,pc Point to 'opcode type' index
369 lda <u002B 388 andb #%00001111 Mask out non-index information
370 bita #$20 389 lslb adjust for 2 bytes per offset entry
371 beq L01C4 390 ldd b,y Get offset
372 lda ,x 391 jsr d,y Execute routine
373 clr ,x+ 392 lda <u002B Operand present flag set?
374 cmpa #$0D 393 bita #Operand
375 beq L01D3 394 beq L01C4 No, skip ahead
376 L01C4 lbsr L1164 395 lda ,x Get next char in source code
377 cmpa #$0D 396 clr ,x+ Clear that char in source line
378 beq L01D3 397 cmpa #$0D Was it a CR?
379 ldb <u002B 398 beq L01D3 Yes, skip ahead
380 beq L01D3 399 L01C4 lbsr L1164 Find next field
381 orb #$40 400 cmpa #$0D End of line?
401 beq L01D3 Yes, skip ahead
402 ldb <u002B Get flags
403 beq L01D3 If do nothing, skip ahead
404 orb #Comment Set Comment field preseent flag
382 stb <u002B 405 stb <u002B
383 L01D3 ldb <u005D 406 L01D3 ldb <u005D One of the command line option flags???
384 beq L01DB 407 beq L01DB
385 ldb <u0021 408 ldb <u0021
386 bne L01F2 409 bne L01F2
387 L01DB ldd <u0040 410 L01DB ldd <u0040
388 addb <u0046 411 addb <u0046
394 L01EA sta ,x+ 417 L01EA sta ,x+
395 decb 418 decb
396 bne L01EA 419 bne L01EA
397 L01EF ldx <u0004 420 L01EF ldx <u0004
398 rts 421 rts
422
399 L01F2 ldb <u003E 423 L01F2 ldb <u003E
400 beq L01EF 424 beq L01EF
401 ldb <u002B 425 ldb <u002B
402 beq L01EF 426 beq L01EF
403 bsr L01E5 427 bsr L01E5
521 pshs u 545 pshs u
522 cmpx ,s++ 546 cmpx ,s++
523 bcc L02F8 547 bcc L02F8
524 tfr u,x 548 tfr u,x
525 L02F8 puls pc,u 549 L02F8 puls pc,u
526 L02FA pshs u,y,x,b,a 550
551 * Error printing routine
552 * Entry: B=Internal error # (table entry #)
553 L02FA pshs u,y,x,d Preserve regs
527 tst <u005C 554 tst <u005C
528 beq L0325 555 beq L0325
529 leay >L061C,pcr 556 leay >L061C,pc Point to '***** Error' string
530 ldx <u0004 557 ldx <u0004
531 lbsr L11BD 558 lbsr L11BD Go print it
532 clra 559 clra Table offset is B-1
533 decb 560 decb
534 lslb 561 lslb Adjust for 2 byte entries
535 leay >L062A,pcr 562 leay >L062A,pc Point to some table
536 ldd d,y 563 ldd d,y Get 2 bytes @ offset D
537 leay d,y 564 leay d,y Point to Y to offset
538 lbsr L11BD 565 lbsr L11BD Go print actual error message
539 ldb $01,s 566 ldb $01,s
540 cmpb #$18 567 cmpb #$18
541 bne L0322 568 bne L0322
542 ldy $02,s 569 ldy $02,s
543 bsr L033D 570 bsr L033D
544 L0322 lbsr L1368 571 L0322 lbsr L1368
545 L0325 inc <u0021 572 L0325 inc <u0021
546 inc <u0029 573 inc <u0029
547 bne L032D 574 bne L032D
548 inc <u0028 575 inc <u0028
549 L032D puls pc,u,y,x,b,a 576 L032D puls pc,u,y,x,d Restore regs & return
550 lbsr L01E5 577 lbsr L01E5
551 ldb #$18 578 ldb #$18
552 bsr L02E2 579 bsr L02E2
553 ldy <u0000 580 ldy <u0000
554 bra L033D 581 bra L033D
555 L033B sta ,x+ 582
583 L033B sta ,x+ Copy string up until CR & return
556 L033D lda ,y+ 584 L033D lda ,y+
557 cmpa #$0D 585 cmpa #$0D
558 bne L033B 586 bne L033B
559 rts 587 rts
560 L0344 pshs x,b 588 * Find opcode match
561 L0346 lda ,y+ 589 * Entry: Y=Table ptr to look in for match
562 bmi L035E 590 * X=Ptr to part of source we are currently checking
563 eora ,x+ 591 * B=# opcodes in current table
564 anda #$DF 592 * Exit: Carry set if no matching mnemonic found
565 beq L0346 593 * Carry clear & Y is ptr to opcode & flag bytes is match IS found
566 L0350 lda ,y+ 594 L0344 pshs x,b Preserve source code ptr & # opcodes in table
595 L0346 lda ,y+ Get byte from table
596 bmi L035E If high bit set, skip ahead
597 eora ,x+ ???
598 anda #$DF Uppercase conversion
599 beq L0346 If matches, keep doing until last character
600 L0350 lda ,y+ Doesn't match, search for end of current entry
567 bpl L0350 601 bpl L0350
568 L0354 leay $02,y 602 L0354 leay $02,y Skip opcode & flag bytes too
569 ldx $01,s 603 ldx $01,s Reset source code ptr to start of instruction
570 decb 604 decb Dec # opcodes counter
571 bne L0346 605 bne L0346 Check until all are done
572 comb 606 comb All done, illegal opcode
573 puls pc,x,b 607 puls pc,x,b Exit with error flag set
574 L035E eora ,x+ 608 * Matches so far, on last byte of text mnemonic
575 anda #$5F 609 L035E eora ,x+ ???
576 bne L0354 610 anda #$5F Mask to uppercase & get rid of high bit
577 leas $03,s 611 bne L0354 Doesn't match, check next
578 clrb 612 leas $03,s Eat stack
579 rts 613 clrb No error & return
614 rts
615
580 L0368 lbsr L1164 616 L0368 lbsr L1164
581 bsr L03A0 617 bsr L03A0
582 bcs L03B7 618 bcs L03B7
583 pshs u,y 619 pshs u,y
584 ldu <u0016 620 ldu <u0016
585 ldb #$08 621 ldb #$08 Max # chars in label?
586 leax $01,x 622 leax 1,x
587 bra L0393 623 bra L0393
588 L0379 lda ,x+ 624
589 bsr L03A0 625 * Copy label into label table (only use most significiant 8 chars)?
590 bcc L0393 626 L0379 lda ,x+ Get char
591 cmpa #$39 627 bsr L03A0 Check text chars
592 bhi L039A 628 bcc L0393 Found one, skip special parsing
593 cmpa #$30 629 cmpa #'9 Higher than a 9?
594 bcc L0393 630 bhi L039A Yes, skip ahead
595 cmpa #$2E 631 cmpa #'0 Is it a number?
596 beq L0393 632 bhs L0393 Yes, go process
597 cmpa #$24 633 cmpa #'. Is it a period?
598 beq L0393 634 beq L0393 Yes, go process
599 cmpa #$5F 635 cmpa #'$ Is it a dollar sign?
600 bne L039A 636 beq L0393 Yes, go process
601 L0393 sta ,u+ 637 cmpa #'_ Is it an underscore?
602 decb 638 bne L039A No, skip ahead
639 * A=numeric, period, dollar sign or underscore
640 L0393 sta ,u+ Store character in label index
641 decb Do all 8 chars
603 bne L0379 642 bne L0379
604 bra L039C 643 bra L039C Skip ahead
605 L039A leax -$01,x 644 L039A leax -1,x
606 L039C clr ,u+ 645 L039C clr ,u+ Append a NUL
607 puls pc,u,y 646 puls pc,u,y Restore regs & return
608 L03A0 cmpa #$41 647
609 bcs L03B5 648 L03A0 cmpa #'A Uppercase A?
610 cmpa #$5A 649 blo L03B5 Lower, return
650 cmpa #'Z If higher than uppercase Z, check for lower
611 bhi L03AD 651 bhi L03AD
612 L03A8 anda #$5F 652 L03A8 anda #$5F Force to uppercase (redundant if already upper)
613 andcc #^Carry 653 andcc #$FE Clear carry (found text byte) & return
614 rts 654 rts
615 L03AD cmpa #$61 655 L03AD cmpa #'a If between 'Z' & 'a', we didn't find text char
616 bcs L03B5 656 blo L03B5
617 cmpa #$7A 657 cmpa #'z If found lowercase text, convert to upper
618 bls L03A8 658 bls L03A8
619 L03B5 orcc #Carry 659 L03B5 orcc #$01 Non-alphabetic, set carry & return
620 L03B7 rts 660 L03B7 rts
661 * Opcode & Pseudo Opcode Table
662 * Mnemonic words are high bit terminated
663 * First numeric byte is the base opcode (before addressing modes considered)
664 * 2nd is flags:
665 * Least significiant 4 bits = index into handler table
666 * 0= LBRA & LBSR (non comparitive long branches/no pre-byte)
667 * 1= Immediate (no register options) ex. ORCC
668 * 2= 16 bit register commands
669 * 3= 8 bit register commands
670 * 4= CLR, etc. Inherent (A,B,D,E,F,W all supported)
671 * 5= 'Fixed' (register not negotiable) inherent commands
672 * 6= LEAx - Indexed only
673 * 7= Register to register (TFR,EXG) (now patched for dual size 0 register)
674 * 8=
675 * 9= 16 bit Relative comparitive branches setup flag
676 * A= 8 bit Relative comparitive branches
677 * B=
678 * C= Pseudo op
679 * D= Pseudo op conditionals (IFxx)
680 * E= Pseudo op (ELSE & ENDC)
681 * F= UNUSED
682 * Most significiant 4 bits
683 * %00010000 : $10 prefix byte always needed
684 * %00100000 : $11 prefix byte always needed
685 * %01000000 : Immediate mode illegal
686 * %10000000 : Default to extended mode
687
621 L03B8 fcs "ORG" 688 L03B8 fcs "ORG"
622 fdb $000C 689 fcb $00,$0C
623 fcs "ENDC" 690 fcs "ENDC"
624 fdb $000E 691 fcb $00,$0E
692 * Long branches without prebyte
625 fcs "LBRA" 693 fcs "LBRA"
626 fdb $1600 694 fcb $16,$00
627 fcs "LBSR" 695 fcs "LBSR"
628 fdb $1700 696 fcb $17,$00
697 * Immediate with no options for register names
629 fcs "ORCC" 698 fcs "ORCC"
630 fdb $1A01 699 fcb $1A,$01
631 fcs "ANDCC" 700 fcs "ANDCC"
632 fdb $1C01 701 fcb $1C,$01
633 fcs "CWAI" 702 fcs "CWAI"
634 fdb $3C01 703 fcb $3C,$01
704 fcs "LDMD"
705 fcb $3d,$21
706 fcs "BITMD"
707 fcb $3c,$21
708 * Register to register commands (need to be here since ADD would match too
709 * early)
710 fcs "ADDR"
711 fcb $30,$17
712 fcs "ADCR"
713 fcb $31,$17
714 fcs "SUBR"
715 fcb $32,$17
716 fcs "SBCR"
717 fcb $33,$17
718 fcs "ANDR"
719 fcb $34,$17
720 fcs "ORR"
721 fcb $35,$17
722 fcs "EORR"
723 fcb $36,$17
724 fcs "CMPR"
725 fcb $37,$17
726
727 * 16 bit register commands
635 fcs "ADDD" 728 fcs "ADDD"
636 fdb $C302 729 fcb $C3,$02
637 fcs "SUBD" 730 fcs "SUBD"
638 fdb $8302 731 fcb $83,$02
639 fcs "LDD" 732 fcs "LDD"
640 fdb $CC02 733 fcb $CC,$02
641 fcs "LDX" 734 fcs "LDX"
642 fdb $8E02 735 fcb $8E,$02
643 fcs "LDU" 736 fcs "LDU"
644 fdb $CE02 737 fcb $CE,$02
645 fcs "CMPX" 738 fcs "CMPX"
646 fdb $8C02 739 fcb $8C,$02
647 fcs "JSR" 740 fcs "JSR"
648 fdb $8D42 741 fcb $8D,$40+$02 Immediate mode not allowed
649 fcs "STD" 742 fcs "STD"
650 fdb $CD42 743 fcb $CD,$42
651 fcs "STX" 744 fcs "STX"
652 fdb $8F42 745 fcb $8F,$42
653 fcs "STU" 746 fcs "STU"
654 fdb $CF42 747 fcb $CF,$42
655 fcs "CMPU" 748 fcs "CMPU"
656 fdb $8322 749 fcb $83,$22
657 fcs "CMPS" 750 fcs "CMPS"
658 fdb $8C22 751 fcb $8C,$22
659 fcs "CMPD" 752 fcs "CMPD"
660 fdb $8312 753 fcb $83,$12
661 fcs "CMPY" 754 fcs "CMPY"
662 fdb $8C12 755 fcb $8C,$12
663 fcs "LDY" 756 fcs "LDY"
664 fdb $8E12 757 fcb $8E,$12
665 fcs "LDS" 758 fcs "LDS"
666 fdb $CE12 759 fcb $CE,$12
667 fcs "STY" 760 fcs "STY"
668 fdb $8F52 761 fcb $8F,$52
669 fcs "STS" 762 fcs "STS"
670 fdb $CF52 763 fcb $CF,$52
764 * 6309 additions here
765 fcs "SUBW"
766 fcb $80,$12
767 fcs "CMPW"
768 fcb $81,$12
769 fcs "SBCD"
770 fcb $82,$12
771 fcs "ANDD"
772 fcb $84,$12
773 fcs "BITD"
774 fcb $85,$12
775 fcs "LDW"
776 fcb $86,$12
777 fcs "STW"
778 fcb $87,$52 Immediate mode illegal
779 fcs "EORD"
780 fcb $88,$12
781 fcs "ADCD"
782 fcb $89,$12
783 fcs "ORD"
784 fcb $8A,$12
785 fcs "ADDW"
786 fcb $8B,$12
787 fcs "DIVQ"
788 fcb $8E,$22
789 fcs "MULD"
790 fcb $8F,$22
791 fcs "STQ"
792 fcb $CD,$52 Immediate mode illegal
793 fcs "LDQ"
794 fcb $CC,$12 Immediate needs new routine
795 * 8 bit register commands (handles A,B,E,F)
671 fcs "ADD" 796 fcs "ADD"
672 fdb $8B03 797 fcb $8B,$03
673 fcs "CMP" 798 fcs "CMP"
674 fdb $8103 799 fcb $81,$03
675 fcs "SUB" 800 fcs "SUB"
676 fdb $8003 801 fcb $80,$03
677 fcs "SBC" 802 fcs "SBC"
678 fdb $8203 803 fcb $82,$03
679 fcs "AND" 804 fcs "AND"
680 fdb $8403 805 fcb $84,$03
681 fcs "BIT" 806 fcs "BIT"
682 fdb $8503 807 fcb $85,$03
683 fcs "LD" 808 fcs "LD"
684 fdb $8603 809 fcb $86,$03
685 fcs "ST" 810 fcs "ST"
686 fdb $8743 811 fcb $87,$43 Immediate mode not allowed
687 fcs "EOR" 812 fcs "EOR"
688 fdb $8803 813 fcb $88,$03
689 fcs "ADC" 814 fcs "ADC"
690 fdb $8903 815 fcb $89,$03
691 fcs "OR" 816 fcs "OR"
692 fdb $8A03 817 fcb $8A,$03
818 fcs "DIVD"
819 fcb $8D,$23
820 * Inherent register commands (now handles A,B,E,F,D & W)
693 fcs "NEG" 821 fcs "NEG"
694 fdb $0004 822 fcb $00,$04
695 fcs "COM" 823 fcs "COM"
696 fdb $0304 824 fcb $03,$04
697 fcs "LSR" 825 fcs "LSR"
698 fdb $0404 826 fcb $04,$04
699 fcs "ROR" 827 fcs "ROR"
700 fdb $0604 828 fcb $06,$04
701 fcs "ASR" 829 fcs "ASR"
702 fdb $0704 830 fcb $07,$04
703 fcs "LSL" 831 fcs "LSL"
704 fdb $0804 832 fcb $08,$04
705 fcs "ASL" 833 fcs "ASL"
706 fdb $0804 834 fcb $08,$04
707 fcs "ROL" 835 fcs "ROL"
708 fdb $0904 836 fcb $09,$04
709 fcs "DEC" 837 fcs "DEC"
710 fdb $0A04 838 fcb $0A,$04
711 fcs "INC" 839 fcs "INC"
712 fdb $0C04 840 fcb $0C,$04
713 fcs "TST" 841 fcs "TST"
714 fdb $0D04 842 fcb $0D,$04
715 fcs "JMP" 843 fcs "JMP"
716 fdb $0E44 844 fcb $0E,$40+$04
717 fcs "CLR" 845 fcs "CLR"
718 fdb $0F04 846 fcb $0F,$04
847 * "Fixed" inherent commands (no options for register names)
848 * Single, unique opcode
719 fcs "RTS" 849 fcs "RTS"
720 fdb $3905 850 fcb $39,$05
721 fcs "MUL" 851 fcs "MUL"
722 fdb $3D05 852 fcb $3D,$05
723 fcs "NOP" 853 fcs "NOP"
724 fdb $1205 854 fcb $12,$05
725 fcs "SYNC" 855 fcs "SYNC"
726 fdb $1305 856 fcb $13,$05
727 fcs "DAA" 857 fcs "DAA"
728 fdb $1905 858 fcb $19,$05
859 fcs "SEXW"
860 fcb $14,$05
729 fcs "SEX" 861 fcs "SEX"
730 fdb $1D05 862 fcb $1D,$05
731 fcs "ABX" 863 fcs "ABX"
732 fdb $3A05 864 fcb $3A,$05
733 fcs "RTI" 865 fcs "RTI"
734 fdb $3B05 866 fcb $3B,$05
735 fcs "SWI2" 867 fcs "SWI2"
736 fdb $3F15 868 fcb $3F,$15
737 fcs "SWI3" 869 fcs "SWI3"
738 fdb $3F25 870 fcb $3F,$25
739 fcs "SWI" 871 fcs "SWI"
740 fdb $3F05 872 fcb $3F,$05
873 fcs "PSHSW"
874 fcb $38,$15
875 fcs "PULSW"
876 fcb $39,$15
877 fcs "PSHUW"
878 fcb $3A,$15
879 fcs "PULUW"
880 fcb $3B,$15
881 * Load effective address: Indexing mode ONLY
741 fcs "LEAX" 882 fcs "LEAX"
742 fdb $3006 883 fcb $30,$06
743 fcs "LEAY" 884 fcs "LEAY"
744 fdb $3106 885 fcb $31,$06
745 fcs "LEAS" 886 fcs "LEAS"
746 fdb $3206 887 fcb $32,$06
747 fcs "LEAU" 888 fcs "LEAU"
748 fdb $3306 889 fcb $33,$06
890 * Register to register
749 fcs "TFR" 891 fcs "TFR"
750 fdb $1F07 892 fcb $1F,$07
751 fcs "EXG" 893 fcs "EXG"
752 fdb $1E07 894 fcb $1E,$07
895 fcs "TFM"
896 fcb $38,$27 Prebyte of $11
897 * Stack push/pull
753 fcs "PSHS" 898 fcs "PSHS"
754 fdb $3408 899 fcb $34,$08
755 fcs "PULS" 900 fcs "PULS"
756 fdb $3508 901 fcb $35,$08
757 fcs "PSHU" 902 fcs "PSHU"
758 fdb $3608 903 fcb $36,$08
759 fcs "PULU" 904 fcs "PULU"
760 fdb $3708 905 fcb $37,$08
761 fcs "LB" 906 * Normal long branches (except LBRA & LBSR) - probably sets flag & then
762 fdb $0019 907 * carries on through short branch table below
908 fcs "LB" for long branches?
909 fcb $00,$19
910
911 * Short branches
763 L0530 fcs "BSR" 912 L0530 fcs "BSR"
764 fdb $8D0A 913 fcb $8D,$0A
765 fcs "BRA" 914 fcs "BRA"
766 fdb $200A 915 fcb $20,$0A
767 fcs "BRN" 916 fcs "BRN"
768 fdb $210A 917 fcb $21,$0A
769 fcs "BHI" 918 fcs "BHI"
770 fdb $220A 919 fcb $22,$0A
771 fcs "BLS" 920 fcs "BLS"
772 fdb $230A 921 fcb $23,$0A
773 fcs "BHS" 922 fcs "BHS"
774 fdb $240A 923 fcb $24,$0A
775 fcs "BCC" 924 fcs "BCC"
776 fdb $240A 925 fcb $24,$0A
777 fcs "BLO" 926 fcs "BLO"
778 fdb $250A 927 fcb $25,$0A
779 fcs "BCS" 928 fcs "BCS"
780 fdb $250A 929 fcb $25,$0A
781 fcs "BNE" 930 fcs "BNE"
782 fdb $260A 931 fcb $26,$0A
783 fcs "BEQ" 932 fcs "BEQ"
784 fdb $270A 933 fcb $27,$0A
785 fcs "BVC" 934 fcs "BVC"
786 fdb $280A 935 fcb $28,$0A
787 fcs "BVS" 936 fcs "BVS"
788 fdb $290A 937 fcb $29,$0A
789 fcs "BPL" 938 fcs "BPL"
790 fdb $2A0A 939 fcb $2A,$0A
791 fcs "BMI" 940 fcs "BMI"
792 fdb $2B0A 941 fcb $2B,$0A
793 fcs "BGE" 942 fcs "BGE"
794 fdb $2C0A 943 fcb $2C,$0A
795 fcs "BLT" 944 fcs "BLT"
796 fdb $2D0A 945 fcb $2D,$0A
797 fcs "BGT" 946 fcs "BGT"
798 fdb $2E0A 947 fcb $2E,$0A
799 fcs "BLE" 948 fcs "BLE"
800 fdb $2F0A 949 fcb $2F,$0A
950
951 * Pseudo ops
801 fcs "RMB" 952 fcs "RMB"
802 fdb $000B 953 fcb $00,$0B
803 fcs "FCC" 954 fcs "FCC"
804 fdb $010B 955 fcb $01,$0B
805 fcs "FDB" 956 fcs "FDB"
806 fdb $020B 957 fcb $02,$0B
807 fcs "FCS" 958 fcs "FCS"
808 fdb $030B 959 fcb $03,$0B
809 fcs "FCB" 960 fcs "FCB"
810 fdb $040B 961 fcb $04,$0B
811 fcs "EQU" 962 fcs "EQU"
812 fdb $050B 963 fcb $05,$0B
813 fcs "MOD" 964 fcs "MOD"
814 fdb $060B 965 fcb $06,$0B
815 fcs "EMOD" 966 fcs "EMOD"
816 fdb $070B 967 fcb $07,$0B
817 fcs "SETDP" 968 fcs "SETDP"
818 fdb $070C 969 fcb $07,$0C
819 fcs "SET" 970 fcs "SET"
820 fdb $080B 971 fcb $08,$0B
821 fcs "OS9" 972 fcs "OS9"
822 fdb $090B 973 fcb $09,$0B
823 fcs "END" 974 fcs "END"
824 fdb $010C 975 fcb $01,$0C
825 fcs "NAM" 976 fcs "NAM"
826 fdb $020C 977 fcb $02,$0C
827 fcs "OPT" 978 fcs "OPT"
828 fdb $030C 979 fcb $03,$0C
829 fcs "TTL" 980 fcs "TTL"
830 fdb $040C 981 fcb $04,$0C
831 fcs "PAG" 982 fcs "PAG"
832 fdb $050C 983 fcb $05,$0C
833 fcs "SPC" 984 fcs "SPC"
834 fdb $060C 985 fcb $06,$0C
835 fcs "USE" 986 fcs "USE"
836 fdb $080C 987 fcb $08,$0C
988 * Conditional assembly switches
837 fcs "IFEQ" 989 fcs "IFEQ"
838 fdb $000D 990 fcb $00,$0D
839 fcs "IFNE" 991 fcs "IFNE"
840 fdb $010D 992 fcb $01,$0D
841 fcs "IFLT" 993 fcs "IFLT"
842 fdb $020D 994 fcb $02,$0D
843 fcs "IFLE" 995 fcs "IFLE"
844 fdb $030D 996 fcb $03,$0D
845 fcs "IFGE" 997 fcs "IFGE"
846 fdb $040D 998 fcb $04,$0D
847 fcs "IFGT" 999 fcs "IFGT"
848 fdb $050D 1000 fcb $05,$0D
849 fcs "IFP1" 1001 fcs "IFP1"
850 fdb $060D 1002 fcb $06,$0D
851 fcs "ELSE" 1003 fcs "ELSE"
852 fdb $010E 1004 fcb $01,$0E
853 L061C fcc "***** Error: " 1005
1006 L061C fcc '***** Error: '
854 fcb $00 1007 fcb $00
855 L062A fdb $0035 1008
856 fdb $003F 1009 * Pointers to error messages table
857 fdb $0049 1010 L062A fdb L065F-L062A Point to 'bad label'
858 fdb $0053 1011 fdb L0669-L062A Point to 'bad instr'
859 fdb $005C 1012 fdb L0673-L062A Point to 'in number'
860 fdb $005E 1013 fdb L067D-L062A Point to 'div by 0'
861 fdb $006A 1014 fdb L0686-L062A Point to ' '
862 fdb $0071 1015 fdb L0688-L062A Point to 'expr syntax'
863 fdb $0080 1016 fdb L0694-L062A Point to 'parens'
864 fdb $008f 1017 fdb L069B-L062A Point to 'redefined name'
865 fdb $0097 1018 fdb L06AA-L062A Point to 'undefined name'
866 fdb $00A9 1019 fdb L06B9-L062A Point to 'phasing'
867 fdb $00B6 1020 fdb L06C1-L062A Point to 'symbol table full'
868 fdb $00C3 1021 fdb L06D3-L062A Point to 'address mode'
869 fdb $00CE 1022 fdb L06E0-L062A Point to 'out of range'
870 fdb $00D7 1023 fdb L06ED-L062A Point to 'result>255'
871 fdb $00E1 1024 fdb L06F8-L062A Point to 'reg name'
872 fdb $00EC 1025 fdb L0701-L062A Point to 'reg sizes'
873 fdb $00F8 1026 fdb L070B-L062A Point to 'input path'
874 fdb $0102 1027 fdb L0716-L062A Point to 'object path'
875 fdb $010C 1028 fdb L0722-L062A Point to 'index reg'
876 fdb $0118 1029 fdb L072C-L062A Point to '] missing'
877 fdb $0121 1030 fdb L0736-L062A Point to 'needs label'
878 fdb $012B 1031 fdb L0742-L062A Point to 'opt list'
879 fdb $0137 1032 fdb L074B-L062A Point to 'const def'
880 fdb $0149 1033 fdb L0755-L062A Point to 'can't open'
881 fcb $00 1034 fdb L0761-L062A Point to 'label not allowed'
882 L065F fcc "bad label" 1035 fdb L0773-L062A Point to 'cond nesting'
883 fcb $00 1036 L065E fcb $00
884 L0667 fcc "bad instr" 1037 L065F fcc 'bad label'
885 fcb $00 1038 L0668 fcb $00
886 L0673 fcc "in number" 1039 L0669 fcc 'bad instr'
887 fcb $00 1040 L0672 fcb $00
888 L067C fcc "div by 0" 1041 L0673 fcc 'in number'
889 fcb $00 1042 L067C fcb $00
890 L0686 fcc " " 1043 L067D fcc 'div by 0'
891 fcb $00 1044 L0685 fcb $00
892 L0688 fcc "expr syntax" 1045 L0686 fcc ' '
893 fcb $00 1046 L0687 fcb $00
894 L0693 fcc "parens" 1047 L0688 fcc 'expr syntax'
895 fcb $00 1048 L0693 fcb $00
896 L069B fcc "redefined name" 1049 L0694 fcc 'parens'
897 fcb $00 1050 L069A fcb $00
898 L06A9 fcc "undefined name" 1051 L069B fcc 'redefined name'
899 fcb $00 1052 L06A9 fcb $00
900 L06B8 fcc "phasing" 1053 L06AA fcc 'undefined name'
901 fcb $00 1054 L06B8 fcb $00
902 L06C1 fcc "symbol table full" 1055 L06B9 fcc 'phasing'
903 fcb $00 1056 L06C0 fcb $00
904 L06D2 fcc "address mode" 1057 L06C1 fcc 'symbol table full'
905 fcb $00 1058 L06D2 fcb $00
906 L06E0 fcc "out of range" 1059 L06D3 fcc 'address mode'
907 fcb $00 1060 L06DF fcb $00
908 L06EC fcc "result>255" 1061 L06E0 fcc 'out of range'
909 fcb $00 1062 L06EC fcb $00
910 L06F7 fcc "reg name" 1063 L06ED fcc 'result>255'
911 fcb $00 1064 L06F7 fcb $00
912 L0701 fcc "reg sizes" 1065 L06F8 fcc 'reg name'
913 fcb $00 1066 L0700 fcb $00
914 L070A fcc "input path" 1067 L0701 fcc 'reg sizes'
915 fcb $00 1068 L070A fcb $00
916 L0715 fcc "object path" 1069 L070B fcc 'input path'
917 fcb $00 1070 L0715 fcb $00
918 L0722 fcc "index reg" 1071 L0716 fcc 'object path'
919 fcb $00 1072 L0721 fcb $00
920 L072C fcc "] missing" 1073 L0722 fcc 'index reg'
921 fcb $00 1074 L072B fcb $00
922 L0736 fcc "needs label" 1075 L072C fcc '] missing'
923 fcb $00 1076 L0735 fcb $00
924 L0742 fcc "opt list" 1077 L0736 fcc 'needs label'
925 fcb $00 1078 L0741 fcb $00
926 L074B fcc "const def" 1079 L0742 fcc 'opt list'
927 fcb $00 1080 L074A fcb $00
928 L0755 fcc "can't open " 1081 L074B fcc 'const def'
929 fcb $00 1082 L0754 fcb $00
930 L0761 fcc "label not allowed" 1083 L0755 fcc /can't open /
931 fcb $00 1084 L0760 fcb $00
932 L0773 fcc "cond nesting" 1085 L0761 fcc 'label not allowed'
933 fcb $00 1086 L0772 fcb $00
934 1087 L0773 fcc 'cond nesting'
935 L0780 fdb $001E 1088 L077F fcb $00
936 fdb $0025 1089
937 fdb $0039 1090 * Index by opcode-type jump table
938 fdb $004E 1091 L0780 fdb L079E-L0780 $001E (LBRA/LBSR) (type 0)
939 fdb $0073 1092 fdb L07A5-L0780 $0025 (orcc/andcc/cwai) (type 1)
940 fdb $00A6 1093 fdb L07B9-L0780 $0039 type 2
941 fdb $00AF 1094 fdb L07CE-L0780 $004E type 3
942 fdb $00C6 1095 fdb L07F3-L0780 $0073 (CLR,etc.) (type 4)
943 fdb $0104 1096 fdb L0826-L0780 $00A6 type 5
944 fdb $011D 1097 fdb L082F-L0780 $00AF type 6
945 fdb $013A 1098 fdb L0846-L0780 $00C6 type 7
946 fdb $015C 1099 fdb L0884-L0780 $0104 type 8
947 fdb $0161 1100 fdb L089D-L0780 $011D
948 fdb $0179 1101 fdb L08BA-L0780 $013A
949 1102 fdb L08DC-L0780 $015C
950 L079C fdb $07A9 1103 fdb L08E1-L0780 $0161
951 lda #$03 1104 fdb L08F9-L0780 $0179
1105 fdb L0F29-L0780 $07A9
1106
1107 * LBRA/LBSR (type 0)
1108 L079E lda #$03 # bytes require for instruction
1109 sta <u0046 Save it
1110 lbra L0951
1111
1112 * orcc/andcc/cwai 2 byte immediate mode only, forced register name (type 1)
1113 L07A5 lbsr L0932 Go find '# for immediate mode
1114 bcc twobyte Found it, skip ahead
1115 ldb #$0C Error code $C 'address mode'
1116 lbsr L02FA
1117 * Legal 8 bit immediate mode goes here
1118 twobyte lda #$01 Force # bytes of instruction to 1
952 sta <u0046 1119 sta <u0046
953 lbra L0951 1120 lda <u0047 Get flag/index option byte
954 lbsr L0932 1121 bita #$20 Pre-byte 11 bit flag on?
955 bcc L07AF 1122 beq L07AF No, 2 byte instruction
956 ldb #$0C 1123 inc <u0046 Add 1 to # bytes to compensate for $11
957 lbsr L02FA 1124 L07AF lbsr L12F7 Immediate mode parser
958 L07AF lbsr L12F7 1125 stb <u0063 Store immediate value following opcode
959 stb <u0063 1126 inc <u0046 Add 1 to # of bytes for immediate value
960 lda #$02 1127 rts
961 sta <u0046 1128
962 rts 1129 * ADDD, LDX, STU etc. (type 2) (16 bit register commands) (all modes)
1130 L07B9 inc <u0046 Add 1 to # bytes needed for instruction
1131 lbsr L0932 Check if immediate mode requested
1132 lbcs L09C6 No, go check memory-based modes
1133 ldd <u0061 Get prebyte & opcode
1134 cmpd #$10CC LDQ?
1135 bne norm16bt No, normal immediate mode
1136 ldd #$00CD Get immediate mode opcode
1137 sta <u0062 Save it over old opcode
1138 lda #$5 # of bytes for LDQ immediate
1139 clr <u0061 Clear out pre-byte
1140 * This is here since 32 bit numeric routines aren't here yet
1141 ldb #$c Error code for 'addr mode'
1142 lbra L02FA Exit with it
1143
1144 norm16bt lbsr L12F1 Calculate immediate mode #'s
1145 std <u0063 Save 16 bit result after opcode
1146 inc <u0046 Add 2 to # bytes needed for instruction
963 inc <u0046 1147 inc <u0046
964 lbsr L0932 1148 lbra L0941 Make sure immediate mode is legal & exit
965 lbcs L09C6 1149
966 lbsr L12F1 1150 * 8 bit A & B based instructions (ADD, SUB, CMP, etc.) (type $03)
967 std <u0063 1151 L07CE inc <u0046 Add 1 to # bytes needed for instruction
968 inc <u0046 1152 ldd <u0061 Get pre-byte & opcode
969 inc <u0046 1153 cmpd #$118d DIVD instruction?
970 lbra L0941 1154 beq L07E7 Yes, skip register name parser
971 inc <u0046 1155 lda ,x+ Get next byte from source
972 lda ,x+ 1156 anda #$5F Force to uppercase
973 anda #$5F 1157 cmpa #'A Is it an A?
974 cmpa #$41 1158 beq L07E7 Yes, go process instruction
975 L07D6 beq L07E7 1159 cmpa #'E Is it an E?
976 cmpa #$42 1160 beq newreg Yes, process
977 beq L07E1 1161 cmpa #'F Is it an F?
978 leas $02,s 1162 bne notnew No, try B
979 lbra L015F 1163 * E or F register
980 L07E1 ldb #$40 1164 newreg pshs a Preserve register name a moment
1165 lda <u0062 Get base opcode
1166 cmpa #$82
1167 blo legalcmd SUB or CMP are ok
1168 cmpa #$86
1169 blo illegal3 SBC,AND & BIT are not ok
1170 cmpa #$88
1171 blo legalcmd Load & store are ok
1172 cmpa #$8b
1173 blo illegal3 EOR, ADC & OR are not ok (ADD falls through ok)
1174 * Legal E/F command, setup
1175 legalcmd lda #$11 Pre-byte for E/F based commands
1176 sta <u0061 Place before opcode
1177 inc <u0046 Add 1 to # bytes needed for instruction
1178 puls a Get back register name
1179 cmpa #'F Is it F?
1180 beq L07E1 Yes, add mask for F
1181 bra L07E7 Go process various modes
1182 notnew cmpa #'B Is it a B?
1183 beq L07E1 Yes, add B mask & process instruction
1184 bra illegal2 Illegal register name
1185
1186 * Illegal register (or illegal command for E or F)
1187 illegal3 leas 1,s Eat E/F identifier byte
1188 illegal2 leas 2,s Eat JSR return address
1189 lbra L015F Exit with 'bad instr' error
1190
1191 * Mask for B or F commands
1192 L07E1 ldb #$40 Add offset for B register to base opcode
981 orb <u0062 1193 orb <u0062
982 stb <u0062 1194 stb <u0062
983 L07E7 lbsr L0932 1195 * Process various modes (Extended, DP, Indexed, Immediate)
984 lbcs L09C6 1196 L07E7 lbsr L0932 Check for immediate mode
985 lbsr L0941 1197 lbcs L09C6 Not immediate, try memory modes
986 bra L07AF 1198 lbsr L0941 Is this command allowed immediate mode?
987 inc <u0046 1199 lbra L07AF Go do immediate mode (8 bit)
988 lda <u0062 1200
989 cmpa #$0E 1201 * CLR/LSL,etc.
990 beq L080B 1202 L07F3 inc <u0046 Inc # bytes in current instruction
991 lda ,x 1203 lda <u0062 Get base opcode
992 anda #$5F 1204 cmpa #$0E Is it JMP?
993 ldb #$40 1205 beq L080B Yes, special case (no inherent)
994 cmpa #$41 1206 * Inherent register name commands
995 beq L0819 1207 lda ,x Get next char from source line
996 ldb #$50 1208 anda #$5F Uppercase only
997 cmpa #$42 1209 * $xx40 commands here
998 beq L0819 1210 ldb #$40 Mask to opcode base for 'xxxA'
999 L080B lbsr L09C6 1211 cmpa #'A Is char an A?
1000 ldb <u0062 1212 beq L0819 Yes, adjust opcode accordingly
1001 bitb #$F0 1213 cmpa #'D Is char a D?
1002 beq L0825 1214 bne notD No, check next
1003 orb #$40 1215 Legal10 lda #$10 Pre-byte for 'D' commands
1216 Legal11 sta <u0061 Put it before the opcode
1217 inc <u0046 Add 1 to # bytes for this instruction
1218 bra L0819 Go append the main opcode
1219 notD cmpa #'E Is char an E?
1220 bne notE No, check next
1221 ChkEF lda <u0062 Get base opcode
1222 beq illegal NEGE/NEGF not allowed
1223 cmpa #$03 COMx?
1224 beq goodE Yes, legal
1225 cmpa #$0A LSR/ROR/ASR/LSL/ASL/ROL?
1226 blo illegal Not allowed
1227 goodE lda #$11 Rest are allowed, set pre-byte to $11
1228 bra Legal11
1229
1230 * $xx50 commands here
1231 notE ldb #$50 Mask to opcode base for 'xxxB'
1232 cmpa #'B Is char a B?
1233 beq L0819 Yes, adjust opcode accordingly
1234 cmpa #'W Is char a W?
1235 bne notW No, check next
1236 lda <u0062 Get base opcode
1237 beq illegal There is no NEGW?
1238 cmpa #$7 ASRW?
1239 beq illegal Yes, there isn't one
1240 cmpa #$8 LSL/ASLW?
1241 bne Legal10 Rest are legal, prefix a $10 & append opcode
1242
1243 * Illegal instructions go here
1244 illegal leas $02,s Eat JSR return address
1245 lbra L015F Exit with illegal opcode error
1246 notW cmpa #'F is it an F?
1247 bne L080B Definately not a register, try memory modes
1248 bra ChkEF Go to generic E/F handler
1249
1250 L080B lbsr L09C6 Generic indexed/extended/direct handler???
1251 ldb <u0062 Get base opcode
1252 bitb #%11110000 Any of the 4 bits of high nibble set?
1253 beq L0825 No, return
1254 orb #%01000000 Yes, force bit on & return
1004 stb <u0062 1255 stb <u0062
1005 rts 1256 rts
1006 L0819 orb <u0062 1257 * Mask in adjustment for register inherent
1007 stb <u0062 1258 L0819 orb <u0062 Merge Mask for new inherent mode into opcode
1008 leax $01,x 1259 stb <u0062 Save new opcode
1009 ldb #$DF 1260 leax 1,x Bump source code ptr up to next char
1010 andb <u002B 1261 ldb #%11011111 Shut off 'operand field in src line' flag
1262 andb <u002B And save new flag byte
1011 stb <u002B 1263 stb <u002B
1012 L0825 rts 1264 L0825 rts
1265
1266 * type 5 - 'fixed' inherent commands (no options for registers, etc.)
1267 L0826 inc <u0046 Add 1 to # bytes this instruction
1268 ldb <u002B
1269 andb #%11011111 Shut off 'operand present' flag
1270 stb <u002B
1271 rts
1272
1273 * type 6 - LEA* (indexed mode ONLY)
1274 L082F inc <u0046 Add 1 to # bytes this instruction
1275 lbsr L09C6 Go set up indexed mode
1276 lda <u004E Get indexed mode flag
1277 bne L0825 Is indexed mode, everything went fine, exit
1278 ldd #$1212 Otherwise, 2 NOP codes
1279 std <u0062 Save as opcodes
1280 ldb #$02 Force # bytes this instruction to 2
1281 stb <u0046
1282 ldb #$0C 'address mode' error
1283 lbra L02FA
1284 * type 7 - TFR/EXG & Register to register
1285 L0846 inc <u0046 at least 2 bytes in this instruction
1013 inc <u0046 1286 inc <u0046
1014 ldb <u002B 1287 lbsr L1164 Find next text field
1015 andb #$DF 1288 lbsr L096B Get 1st register name
1016 stb <u002B 1289 bcc L0857 If we found them, skip ahead
1017 rts 1290 L0852 ldb #$0F If didn't, exit with 'reg name' error
1018 inc <u0046
1019 lbsr L09C6
1020 lda <u004E
1021 bne L0825
1022 ldd #$1212
1023 std <u0062
1024 ldb #$02
1025 stb <u0046
1026 ldb #$0C
1027 lbra L02FA 1291 lbra L02FA
1028 ldb #$02 1292
1029 stb <u0046 1293 L0857 lda ,x+ Get next char
1030 lbsr L1164 1294 cmpa #', comma?
1031 lbsr L096B 1295 bne L0852 No, exit with 'reg name' error
1032 bcc L0857 1296 pshs b Preserve first register mask
1033 L0852 ldb #$0F 1297 lbsr L096B Get 2nd register name
1034 lbra L02FA 1298 puls a Get back 1st register name
1035 L0857 lda ,x+ 1299 bcs L0852 If can't find 2nd, exit with error
1036 cmpa #$2C 1300 pshs d Preserve both
1037 bne L0852 1301 anda #%00001000 Keep 8/16 bit size flag on first
1038 pshs b 1302 andb #%00001000 Keep 8/16 bit size flag on 2nd
1039 lbsr L096B 1303 pshs b Preserve 2nd reg size flag
1040 puls a 1304 eora ,s+ Check if they are same size
1041 bcs L0852 1305 beq L0879 Yes, continue
1042 pshs b,a 1306 lda #%00001100 '0' register mask
1043 anda #$08 1307 cmpa ,s Is source register the 0 register?
1044 andb #$08 1308 beq L0879 Yes, destination size doesn't matter
1045 pshs b 1309 ldb #$10 Otherwise, 'reg sizes' error
1046 eora ,s+
1047 beq L0879
1048 ldb #$10
1049 leas $02,s 1310 leas $02,s
1050 lbra L02FA 1311 lbra L02FA
1051 L0879 puls a 1312
1313 L0879 puls a Get back source register
1314 lsla Move into most significiant nibble
1052 lsla 1315 lsla
1053 lsla 1316 lsla
1054 lsla 1317 lsla
1055 lsla 1318 ora ,s+ Merge with destination register
1056 ora ,s+ 1319 sta <u0063 Save after opcode & return
1320 rts
1321 * type 8 (Stack push/pull)
1322 L0884 ldb #$02 Force # bytes for instruction to 2
1323 stb <u0046
1324 lbsr L1164 Parse to next field
1325 L088B lbsr L096B Get register mask
1326 bcs L0852 Illegal one, exit with 'register name' error
1327 ora <u0063 Mask in bit for new reg into byte after opcode
1057 sta <u0063 1328 sta <u0063
1058 rts 1329 lda ,x+ Get next char from source
1059 ldb #$02 1330 cmpa #', Comma?
1060 stb <u0046 1331 beq L088B Yes, more register masks to get
1061 lbsr L1164 1332 leax -1,x Bump src code ptr back 1 & return
1062 L088B lbsr L096B 1333 rts
1063 bcs L0852 1334 * type 9 (long branches except LBRA/LBSR)
1064 ora <u0063 1335 L089D lda #$04 Force # of bytes of instruction to 4
1065 sta <u0063
1066 lda ,x+
1067 cmpa #$2C
1068 beq L088B
1069 leax -$01,x
1070 rts
1071 lda #$04
1072 sta <u0046 1336 sta <u0046
1073 leax -$01,x 1337 leax -$01,x Bump ptr back to start of mnemonic
1074 ldb #$13 1338 ldb #19 # opcodes to check in table
1075 leay >L0530,pcr 1339 leay >L0530,pc Point to branch opcode tables
1076 lbsr L0344 1340 lbsr L0344 Go find & verify it
1077 bcc L08B3 1341 bcc L08B3 Found it, continue
1078 leas $02,s 1342 leas $02,s Eat stack
1079 lbra L015F 1343 lbra L015F Exit with error
1344
1080 L08B3 lda ,y 1345 L08B3 lda ,y
1081 sta <u0062 1346 sta <u0062
1082 lbra L0951 1347 lbra L0951
1083 lda #$02 1348
1349 * type 10 (short branches)
1350 L08BA lda #$02 Force # of bytes of instruction to 2
1084 sta <u0046 1351 sta <u0046
1085 lbsr L12F1 1352 lbsr L12F1
1086 subd <u0040 1353 subd <u0040
1087 subd #$0002 1354 subd #$0002
1088 cmpd #$007F 1355 cmpd #$007F
1092 L08D2 ldb #$0D 1359 L08D2 ldb #$0D
1093 lbsr L02FA 1360 lbsr L02FA
1094 ldb #$FE 1361 ldb #$FE
1095 L08D9 stb <u0063 1362 L08D9 stb <u0063
1096 rts 1363 rts
1097 leau <L08FE,pcr 1364
1365 * type $B (Pseudo ops)
1366 L08DC leau <L08FE,pc Point to table
1098 bra L08EF 1367 bra L08EF
1099 ldb <u002B 1368
1369 L08E1 ldb <u002B
1100 bitb #$08 1370 bitb #$08
1101 beq L08EC 1371 beq L08EC
1102 ldb #$19 1372 ldb #$19
1103 lbsr L02FA 1373 lbsr L02FA
1104 L08EC leau <L0912,pcr 1374 L08EC leau <L0912,pc Point to table
1105 L08EF lbsr L1164 1375 L08EF lbsr L1164 Hunt down next field in source string
1106 ldb <u0062 1376 ldb <u0062
1107 lslb 1377 lslb 2 byte entries
1108 ldd b,u 1378 ldd b,u
1109 jmp d,u 1379 jmp d,u
1110 leau <L0924,pcr 1380
1381 L08F9 leau <L0924,pc Point to table
1111 bra L08EF 1382 bra L08EF
1112 L08FE fdb $02A8 1383
1113 fdb $0349 1384 * 2 byte jump table
1114 fdb $03C1 1385
1115 fdb $036D 1386 L08FE fdb L0BA6-L08FE
1116 fdb $03AF 1387 fdb L0C47-L08FE
1117 fdb $0329 1388 fdb L0CBF-L08FE
1118 fdb $0462 1389 fdb L0C6B-L08FE
1119 fdb $0442 1390 fdb L0CAD-L08FE
1120 fdb $032D 1391 fdb L0C27-L08FE
1121 fdb $0453 1392 fdb L0D60-L08FE
1122 L0912 fdb $04A7 1393 fdb L0D40-L08FE
1123 fdb $04AF 1394 fdb L0C2B-L08FE
1124 fdb $04C2 1395 fdb L0D51-L08FE
1125 fdb $051A 1396 * Another 2 byte jump table
1126 fdb $04EB 1397 L0912 fdb L0DB9-L0912
1127 fdb $04F1 1398 fdb L0DC1-L0912
1128 fdb $04F7 1399 fdb L0DD4-L0912
1129 fdb $05A1 1400 fdb L0E2C-L0912
1130 fdb $05B2 1401 fdb L0DFD-L0912
1131 L0924 fdb $05BF 1402 fdb L0E03-L0912
1132 fdb $05C4 1403 fdb L0E09-L0912
1133 fdb $05C9 1404 fdb L0EB3-L0912
1134 fdb $05CE 1405 fdb L0EC4-L0912
1135 fdb $05D3 1406
1136 fdb $05D8 1407 * Another 2 byte jump table
1137 fdb $05DD 1408 L0924 fdb L0EE3-L0924
1138 L0932 fcb $17,$08,$2f,$81,$23,$26,$05,$30,$01 1409 fdb L0EE8-L0924
1139 andcc #^Carry 1410 fdb L0EED-L0924
1140 rts 1411 fdb L0EF2-L0924
1141 L093E orcc #Carry 1412 fdb L0EF7-L0924
1142 rts 1413 fdb L0EFC-L0924
1143 L0941 ldb <u0047 1414 fdb L0F01-L0924
1144 bitb #$40 1415
1145 bne L0948 1416 L0932 lbsr L1164 Parse for start of next field
1146 rts 1417 cmpa #'# Immediate mode specifier?
1147 L0948 ldb #$03 1418 bne L093E No, exit with carry set
1419 leax 1,x Bump source ptr up by 1, clear carry & return
1420 andcc #$FE
1421 rts
1422
1423 L093E orcc #$01
1424 rts
1425
1426 * Immediate mode check
1427 L0941 ldb <u0047 Get current opcode's flag byte
1428 bitb #%01000000 Immediate mode legal?
1429 bne L0948 No, do something
1430 rts Yes, return
1431
1432 L0948 ldb #$03 Set size of illegal instruction to 3 bytes
1148 stb <u0046 1433 stb <u0046
1149 ldb #$0C 1434 ldb #$0C Error code $C 'address mode'
1150 lbra L02FA 1435 lbra L02FA
1436
1151 L0951 lbsr L12F1 1437 L0951 lbsr L12F1
1152 subd <u0040 1438 subd <u0040
1153 subb <u0046 1439 subb <u0046
1154 sbca #$00 1440 sbca #$00
1155 std <u0063 1441 std <u0063
1157 bgt L096A 1443 bgt L096A
1158 cmpd #$FF80 1444 cmpd #$FF80
1159 blt L096A 1445 blt L096A
1160 inc <u004F 1446 inc <u004F
1161 L096A rts 1447 L096A rts
1162 L096B leay >L09A2,pcr 1448
1163 pshs x 1449 * Entry: X=ptr to start of reg name from source
1164 ldb #$0C 1450 * Exit: A=Bit mask for PSH/PUL
1165 L0973 lda ,y 1451 * B=Bit mask for EXG/TFR
1166 beq L098F 1452 L096B leay >L09A2,pc Point to register names
1167 cmpa ,x+ 1453 pshs x Save start of current register we are checking
1168 beq L0981 1454 ldb #16 # of register names to check
1169 adda #$20 1455 L0973 lda ,y Get byte from reg. name
1170 cmpa -$01,x 1456 beq L098F If NUL (empty entry), skip this entry
1171 bne L098F 1457 cmpa ,x+ Compare with source
1172 L0981 lda $01,y 1458 beq L0981 Equal, skip ahead
1173 beq L099A 1459 adda #$20 Make lowercase
1174 cmpa ,x+ 1460 cmpa -$01,x Compare with source
1175 beq L099A 1461 bne L098F Not equal, skip ahead
1176 adda #$20 1462 * Found reg name we want
1177 cmpa -$01,x 1463 L0981 lda $01,y Get 2nd char of reg name
1178 beq L099A 1464 beq L099A NUL, only 1 char, so we match
1179 L098F ldx ,s 1465 cmpa ,x+ 2nd char match too?
1180 leay $03,y 1466 beq L099A Yes, found reg
1181 decb 1467 adda #$20 Convert to lowercase
1182 bne L0973 1468 cmpa -$01,x Does that match?
1183 orcc #Carry 1469 beq L099A Yes, found it
1184 puls pc,x 1470 * Not the register name we want, try next one
1185 L099A decb 1471 L098F ldx ,s Get ptr to start of current register
1186 leas $02,s 1472 leay $03,y Bump to next one
1187 lda $02,y 1473 decb Dec # registers left to check counter
1188 andcc #^Carry 1474 bne L0973 Keep doing till done
1189 rts 1475 orcc #$01 Set carry flag (illegal register name)
1190 L09A2 lsra 1476 puls pc,x Restore X & return
1191 negb 1477 * Found register name we wanted
1192 lsl <u0043 1478 L099A decb Adjust B (EXG/TFR mask)
1193 coma 1479 leas $02,s Eat X off the stack
1194 oim #$42,<u0000 1480 lda $02,y Get PSH/PUL bit mask
1195 lsr <u0041 1481 andcc #$FE No error & return
1196 neg <u0002 1482 rts
1197 neg <u0000 1483 * Stack table: 2 bytes for reg. name, 1 byte for bit mask for PSH/PUL
1198 neg <u0000 1484 * Positions (done in reverse from highest to lowest) indicates the bit
1199 neg <u0000 1485 * mask for register to register operations (ex. TFR)
1200 negb 1486 L09A2 fcc 'F' %1111
1201 coma 1487 fcb $00,$00
1202 suba #$53 1488
1203 neg <u0040 1489 fcc 'E' %1110
1204 fcb $55 U 1490 fcb $00,$00
1205 neg <u0040 1491
1206 rolb 1492 fcb $00,$00,$00 %1101 (2nd zero register won't be used)
1207 neg <u0020 1493
1208 lslb 1494 fcc '0' %1100 Zero register
1209 neg <u0010 1495 fcb $00,$00
1210 lsra 1496
1211 neg <u0006 1497 fcc 'DP' %1011
1212 L09C6 lbsr L1164 1498 fcb $08
1213 bsr L0A14 1499
1214 cmpa #$5B 1500 fcc 'CC' %1010
1215 bne L09D7 1501 fcb $01
1216 inc <u004D 1502
1217 leax $01,x 1503 fcc 'B' %1001
1218 lda ,x 1504 fcb $00,$04
1219 bsr L0A14 1505
1220 L09D7 cmpa #$2C 1506 fcc 'A' %1000
1221 lbeq L0A64 1507 fcb $00,$02
1222 ldb $01,x 1508
1223 cmpb #$2C 1509 fcc 'V' %0111
1224 bne L09F1 1510 fcb $00,00
1225 anda #$DF 1511
1226 cmpa #$41 1512 fcc 'W' %0110
1227 beq L0A27 1513 fcb $00,$00
1228 cmpa #$42 1514
1229 beq L0A2B 1515 fcc 'PC' %0101
1230 cmpa #$44 1516 fcb $80
1231 beq L0A2F 1517
1232 L09F1 lbsr L12F1 1518 fcc 'S' %0100
1233 bcc L09F8 1519 fcb $00,$40
1234 clra 1520
1235 clrb 1521 fcc 'U' %0011
1236 L09F8 std <u004A 1522 fcb $00,$40
1237 lda ,x 1523
1238 cmpa #$2C 1524 fcc 'Y' %0010
1239 lbeq L0B18 1525 fcb $00,$20
1240 ldb <u004D 1526
1241 bne L0A35 1527 fcc 'X' %0001
1242 ldb <u004C 1528 fcb $00,$10
1243 bmi L0A35 1529
1244 bne L0A53 1530 fcc 'D' %0000
1531 fcb $00,$06 (A & B combined)
1532
1533 * Generic memory mode addressing handler: Indexed, Extended, Direct Page
1534 L09C6 lbsr L1164 Parse for next field in source
1535 bsr L0A14 Check for '<' (DP) & '>' (Extended) modes
1536 cmpa #'[ Next char indicate indirect mode?
1537 bne L09D7 No, try next
1538 inc <u004D Set flag for indirect mode
1539 leax 1,x Bump src code ptr up by 1
1540 lda ,x Get next byte
1541 bsr L0A14 Check for '<' or '>' & set flag
1542 L09D7 cmpa #', Comma?
1543 lbeq L0A64 Yes, skip ahead for ,R/,R auto inc/dec
1544 * comma is not first char
1545 ldb 1,x No, get next char into B
1546 cmpb #', Is it a comma? (ie 1st was register name?)
1547 bne L09F1 No, try label/number routine ???
1548 anda #$DF Force to uppercase
1549 cmpa #'A Is it an A?
1550 beq L0A27 Yes, go process
1551 cmpa #'B Is it a B?
1552 beq L0A2B Yes, go process
1553 cmpa #'D Is it a D?
1554 beq L0A2F Yes, go process
1555 cmpa #'E Is it an E?
1556 beq MaskE
1557 cmpa #'F Is it an F?
1558 beq MaskF
1559 cmpa #'W Is it a W?
1560 beq MaskW
1561 * Not a R0,xx... try for numeric or label
1562 L09F1 lbsr L12F1 Parse for numeric (returns 16 bit # in D)
1563 bcc L09F8 Found one, preserve it
1564 clra Otherwise, default to 0
1565 clrb
1566 L09F8 std <u004A Save 16 bit address
1567 lda ,x Get char from src code
1568 cmpa #', Comma?
1569 lbeq L0B18 Yes, skip way ahead
1570 ldb <u004D Get indirect mode flag
1571 bne L0A35 If on, skip ahead
1572 ldb <u004C Get Extended/DP/Indexed mode flag
1573 bmi L0A35 If Extended, go do it
1574 bne L0A53 If Direct Page, go somewhere else
1245 lda <u004A 1575 lda <u004A
1246 cmpa <u003F 1576 cmpa <u003F
1247 beq L0A53 1577 beq L0A53
1248 bra L0A35 1578 bra L0A35
1249 L0A14 ldb #$FF 1579
1250 cmpa #$3E 1580 * Check for '>' or '<' (Extended or Direct Page addressing)
1251 beq L0A20 1581 * Set flag @ <u004C to $FF for >, $01 for <
1252 cmpa #$3C 1582 L0A14 ldb #$FF 16 bit addressing flag
1253 bne L0A26 1583 cmpa #'> 16 bit addressing?
1254 ldb #$01 1584 beq L0A20 Yes, set flag
1255 L0A20 stb <u004C 1585 cmpa #'< 8 bit addressing?
1256 leax $01,x 1586 bne L0A26 No, return
1257 lda ,x 1587 ldb #$01 8 bit addressing flag
1588 L0A20 stb <u004C Save bit size addressing flag
1589 leax 1,x Bump source ptr
1590 lda ,x Get next char & return
1258 L0A26 rts 1591 L0A26 rts
1259 L0A27 ldb #$86 1592
1593 * A,R comes here
1594 L0A27 ldb #%10000110
1260 bra L0A31 1595 bra L0A31
1261 L0A2B ldb #$85 1596
1597 * B,R comes here
1598 L0A2B ldb #%10000101
1262 bra L0A31 1599 bra L0A31
1263 L0A2F ldb #$8B 1600
1264 L0A31 leax $01,x 1601 * D,R comes here
1265 bra L0A97 1602 L0A2F ldb #%10001011
1266 L0A35 ldd <u004A 1603 bra L0A31
1604 * E,R comes here
1605 MaskE ldb #%10000111
1606 bra L0A31
1607 * F,R comes here
1608 MaskF ldb #%10001010
1609 bra L0A31
1610 * W,R comes here
1611 MaskW ldb #%10001110
1612 L0A31 leax 1,x Bump src ptr up by 1
1613 bra L0A97 Skip ahead
1614
1615 * Extended Indirect indexed or Extended modes go here
1616 L0A35 ldd <u004A Get 16 bit address
1617 inc <u0046 Add 2 to # bytes for instruction
1267 inc <u0046 1618 inc <u0046
1268 inc <u0046 1619 inc <u004F ???
1269 inc <u004F 1620 tst <u004D Indirect mode on?
1270 tst <u004D 1621 bne L0A4A Yes, Need to add $9F postbyte first
1271 bne L0A4A 1622 std <u0063 Save extended address
1272 std <u0063 1623 ldb #%00110000 Mask in bit flags for extended mode & return
1273 ldb #$30
1274 orb <u0062 1624 orb <u0062
1275 stb <u0062 1625 stb <u0062
1276 rts 1626 rts
1277 L0A4A std <u0064 1627
1278 ldb #$9F 1628 * Extended indirect (ex. JMP [<$2000])
1629 L0A4A std <u0064 Store 16 bit address after post-byte
1630 ldb #%10011111 Append $9f post-byte for Extended Indirect
1279 stb <u0063 1631 stb <u0063
1280 lbra L0AEA 1632 lbra L0AEA
1281 L0A53 inc <u0046 1633
1282 ldb <u004B 1634 * Direct page mode
1283 stb <u0063 1635 L0A53 inc <u0046 Add 1 to # bytes this instruction
1284 ldb <u0062 1636 ldb <u004B Get 8 bit # (LSB of D from L12F1)
1285 bitb #$F0 1637 stb <u0063 Save it as DP address
1286 beq L0A63 1638 ldb <u0062 get opcode
1287 orb #$10 1639 bitb #%11110000 Is it a $0-$F Direct page command?
1640 beq L0A63 Yes, opcode is fine
1641 orb #%00010000 No, force DP mode bit on in opcode
1288 stb <u0062 1642 stb <u0062
1289 L0A63 rts 1643 L0A63 rts
1290 L0A64 leax $01,x 1644
1291 clr <u004A 1645 * Comes here if first char is ',' (after parsing '[' if needed)
1646 L0A64 leax 1,x Bump source ptr up by 1
1647 clr <u004A Clear 16 bit offset address
1292 clr <u004B 1648 clr <u004B
1293 ldd ,x 1649 ldd ,x Get 2 chars from source
1294 cmpd #$2D2D 1650 cmpd #$2D2D '--' ?
1295 beq L0A8D 1651 beq L0A8D Yes, go merge mask for --
1296 cmpa #$2D 1652 cmpa #'- '-' ?
1297 beq L0A93 1653 beq L0A93 Yes, go merge mask for -
1298 bsr L0AC7 1654 bsr L0AC7 Otherwise, Go find base index register (X,Y,U,S)
1299 lbcs L0B68 1655 lbcs L0B68 Couldn't find one, check for 'PC' offset
1300 stb <u0063 1656 * Found base register
1301 ldd ,x 1657 stb <u0063 Save base register bit mask in postbyte
1302 cmpd #$2B2B 1658 ldd ,x Get next 2 chars from src (after base reg. name)
1303 beq L0AAB 1659 cmpd #$2B2B '++' ?
1304 cmpa #$2B 1660 beq L0AAB Yes, go process
1305 beq L0AB1 1661 cmpa #'+ '+' ?
1306 lbra L0B22 1662 beq L0AB1 Yes, go process
1307 L0A8D leax $01,x 1663 lbra L0B22
1308 ldb #$83 1664
1309 bra L0A97 1665 * Mask for double dec. mode
1310 L0A93 bsr L0ABD 1666 L0A8D leax 1,x Bump src ptr up by 1
1311 ldb #$82 1667 ldb #%10000011 Mask for -- mode
1312 L0A97 stb <u0063 1668 bra L0A97 Merge into post byte
1313 leax $01,x 1669 * Mask for single dec. mode
1314 bsr L0AC7 1670 L0A93 bsr L0ABD Make sure we aren't indirect-it's illegal
1315 bcc L0AA5 1671 ldb #%10000010 Mask for - mode
1316 L0A9F ldb #$13 1672 L0A97 stb <u0063 Save mask in postbyte
1673 leax 1,x Bump src ptr up 1 byte
1674 bsr L0AC7 Go get base register (X,Y,U,S)
1675 bcc L0AA5 Found it, merge in base register mask
1676 L0A9F ldb #$13 illegal 'index reg' error
1317 lbsr L02FA 1677 lbsr L02FA
1318 clrb 1678 clrb So clear postbyte to 0
1319 L0AA5 orb <u0063 1679 L0AA5 orb <u0063 Merge in mask into postbyte
1320 stb <u0063 1680 stb <u0063
1321 bra L0AEA 1681 bra L0AEA
1322 L0AAB ldb #$81 1682 * Mask for double inc. mode
1323 leax $01,x 1683 L0AAB ldb #%10000001 Mask for ++ mode
1324 bra L0AB5 1684 leax 1,x Bump up src ptr by 1
1325 L0AB1 bsr L0ABD 1685 bra L0AB5 Merge into postbyte
1326 ldb #$80 1686 * Mask for single inc. mode
1327 L0AB5 leax $01,x 1687 L0AB1 bsr L0ABD Make sure we aren't indirect-it's illegal
1328 orb <u0063 1688 ldb #%10000000 Mask for + mode
1689
1690 L0AB5 leax 1,x Bump up src ptr by 1
1691 orb <u0063 Merge in auto inc. modes
1329 stb <u0063 1692 stb <u0063
1330 bra L0AEA 1693 bra L0AEA
1331 L0ABD tst <u004D 1694
1332 beq L0AC6 1695 * Check ,-R or ,R+: only legal in NON-INDIRECT mode
1333 ldb #$0C 1696 L0ABD tst <u004D Check indirect mode flag
1697 beq L0AC6 Normal, exit
1698 ldb #$0C Indirect ,-R is illegal, exit with error
1334 lbsr L02FA 1699 lbsr L02FA
1335 L0AC6 rts 1700 L0AC6 rts
1336 L0AC7 lda ,x+ 1701
1337 anda #$5F 1702 * Exit: B=bit mask for proper index register (X,Y,U,S)
1338 clrb 1703 * carry set=not legal register
1339 cmpa #$58 1704 L0AC7 lda ,x+ Get next char from source
1705 anda #$5F Force to uppercase
1706 clrb X register mask
1707 cmpa #'X X register?
1708 beq L0AE2 Yes, acceptable
1709 ldb #%00100000 Y register mask
1710 cmpa #'Y Y register
1340 beq L0AE2 1711 beq L0AE2
1341 ldb #$20 1712 ldb #%01000000 U register mask
1342 cmpa #$59 1713 cmpa #'U U register?
1343 beq L0AE2 1714 beq L0AE2
1344 ldb #$40 1715 ldb #%01100000 S register mask
1345 cmpa #$55 1716 cmpa #'S S register?
1346 beq L0AE2 1717 bne L0AE5 No, not a 'x,R' or 'R+/++' situation
1347 ldb #$60 1718 L0AE2 andcc #$FE No error & return
1348 cmpa #$53 1719 rts
1349 bne L0AE5 1720
1350 L0AE2 andcc #^Carry 1721 L0AE5 leax -1,x Bump source ptr back
1351 rts 1722 orcc #$01 Set carry (couldn't find index register) & return
1352 L0AE5 leax -$01,x 1723 rts
1353 orcc #Carry 1724 * Part of indexed mode handler
1354 rts 1725 * This part sets the INDEXED mode bit in the opcode itself, and also sets
1355 L0AEA ldb #$20 1726 * the INDIRECT bit in the postbyte. Both of these are compatible with the new
1356 orb <u0062 1727 * W modes (with W being the base register), so this routine does not have to
1728 * be changed.
1729 L0AEA ldb #%00100000 Mask bit for indexed instruction opcodes
1730 orb <u0062 Force instruction to indexed mode
1357 stb <u0062 1731 stb <u0062
1358 inc <u0046 1732 inc <u0046 Add 1 to size of instruction
1359 inc <u004E 1733 inc <u004E ???
1360 tst <u004D 1734 tst <u004D Indirect mode active?
1361 beq L0B08 1735 beq L0B08 No, skip ahead
1362 ldb #$10 1736 ldb #%00010000 Indirect mode bit mask
1363 orb <u0063 1737 orb <u0063 Mask into Postbyte
1364 stb <u0063 1738 stb <u0063
1365 lda ,x+ 1739 lda ,x+ Get next char from source
1366 cmpa #$5D 1740 cmpa #'] End of indirect mode?
1367 beq L0B08 1741 beq L0B08 Yes, go check for end of line
1368 ldb #$14 1742 ldb #$14 '] missing' error
1369 bra L0B14 1743 bra L0B14
1370 L0B08 lda ,x 1744
1371 cmpa #$20 1745 L0B08 lda ,x Get char from source
1372 beq L0B17 1746 cmpa #$20 Space?
1373 cmpa #$0D 1747 beq L0B17 Yes, exit
1374 beq L0B17 1748 cmpa #$0D CR?
1375 ldb #$0C 1749 beq L0B17 Yes, exit
1750 ldb #$0C 'Address mode' error
1376 L0B14 lbsr L02FA 1751 L0B14 lbsr L02FA
1377 L0B17 rts 1752 L0B17 rts No error & return
1378 L0B18 leax $01,x 1753
1754 L0B18 leax 1,x Bump src ptr up by 1
1379 bsr L0AC7 1755 bsr L0AC7
1380 bcs L0B68 1756 bcs L0B68
1381 orb <u0063 1757 orb <u0063
1382 stb <u0063 1758 stb <u0063
1383 L0B22 ldd <u004A 1759 L0B22 ldd <u004A
1437 L0B9B subd #$0001 1813 L0B9B subd #$0001
1438 inc <u0046 1814 inc <u0046
1439 std <u0064 1815 std <u0064
1440 ldb #$8D 1816 ldb #$8D
1441 bra L0B62 1817 bra L0B62
1442 bsr L0BE4 1818
1443 pshs b,a 1819 L0BA6 bsr L0BE4
1820 pshs d
1444 addd <u0026 1821 addd <u0026
1445 std <u0026 1822 std <u0026
1446 bsr L0BEF 1823 bsr L0BEF
1447 beq L0BB6 1824 beq L0BB6
1448 lda #$04 1825 lda #$04
1504 ldb #$0A 1881 ldb #$0A
1505 lbsr L02FA 1882 lbsr L02FA
1506 L0C22 puls b,a 1883 L0C22 puls b,a
1507 L0C24 std u0009,u 1884 L0C24 std u0009,u
1508 L0C26 rts 1885 L0C26 rts
1509 lda #$03 1886 L0C27 lda #$03
1510 bra L0C2D 1887 bra L0C2D
1511 lda #$02 1888 L0C2B lda #$02
1512 L0C2D bsr L0BEF 1889 L0C2D bsr L0BEF
1513 bne L0C38 1890 bne L0C38
1514 ldb #$15 1891 ldb #$15
1515 lbsr L02FA 1892 lbsr L02FA
1516 bra L0C46 1893 bra L0C46
1520 bsr L0C0A 1897 bsr L0C0A
1521 std <u0044 1898 std <u0044
1522 ldb #$39 1899 ldb #$39
1523 stb <u002B 1900 stb <u002B
1524 L0C46 rts 1901 L0C46 rts
1525 lda ,x+ 1902 L0C47 lda ,x+
1526 pshs a 1903 pshs a
1527 cmpa #$0D 1904 cmpa #$0D
1528 beq L0C64 1905 beq L0C64
1529 cmpa #$2F 1906 cmpa #$2F
1530 bhi L0C64 1907 bhi L0C64
1537 lbsr L0CEC 1914 lbsr L0CEC
1538 bra L0C55 1915 bra L0C55
1539 L0C64 ldb #$17 1916 L0C64 ldb #$17
1540 lbsr L02FA 1917 lbsr L02FA
1541 L0C69 puls pc,a 1918 L0C69 puls pc,a
1542 lda ,x+ 1919 L0C6B lda ,x+
1543 pshs a 1920 pshs a
1544 cmpa #$0D 1921 cmpa #$0D
1545 beq L0C64 1922 beq L0C64
1546 cmpa #$2F 1923 cmpa #$2F
1547 bhi L0C64 1924 bhi L0C64
1570 stx <u0033 1947 stx <u0033
1571 cmpa #$0D 1948 cmpa #$0D
1572 bne L0CAB 1949 bne L0CAB
1573 sta ,x 1950 sta ,x
1574 L0CAB puls pc,x,a 1951 L0CAB puls pc,x,a
1575 bsr L0CD5 1952 L0CAD bsr L0CD5
1576 L0CAF lbsr L12F7 1953 L0CAF lbsr L12F7
1577 tfr b,a 1954 tfr b,a
1578 bsr L0CEC 1955 bsr L0CEC
1579 lda ,x+ 1956 lda ,x+
1580 cmpa #$2C 1957 cmpa #$2C
1581 beq L0CAF 1958 beq L0CAF
1582 leax -$01,x 1959 leax -$01,x
1583 rts 1960 rts
1584 bsr L0CD5 1961 L0CBF bsr L0CD5
1585 L0CC1 lbsr L12F1 1962 L0CC1 lbsr L12F1
1586 pshs b 1963 pshs b
1587 bsr L0CEC 1964 bsr L0CEC
1588 puls a 1965 puls a
1589 bsr L0CEC 1966 bsr L0CEC
1642 std <u0044 2019 std <u0044
1643 clr <u0046 2020 clr <u0046
1644 inc <u002A 2021 inc <u002A
1645 clr $01,s 2022 clr $01,s
1646 puls pc,x,b,a 2023 puls pc,x,b,a
1647 ldd <u0051 2024 L0D40 ldd <u0051
1648 coma 2025 coma
1649 comb 2026 comb
1650 std <u0062 2027 std <u0062
1651 ldb <u0053 2028 ldb <u0053
1652 comb 2029 comb
1653 lda <u002B 2030 lda <u002B
1654 anda #$DF 2031 anda #$DF
1655 sta <u002B 2032 sta <u002B
1656 bra L0D59 2033 bra L0D59
1657 ldd #$103F 2034 L0D51 ldd #$103F
1658 std <u0062 2035 std <u0062
1659 lbsr L12F7 2036 lbsr L12F7
1660 L0D59 stb <u0064 2037 L0D59 stb <u0064
1661 ldb #$03 2038 ldb #$03
1662 stb <u0046 2039 stb <u0046
1663 rts 2040 rts
1664 clra 2041 L0D60 clra
1665 clrb 2042 clrb
1666 stb <u0050 2043 stb <u0050
1667 std <u0040 2044 std <u0040
1668 std <u0044 2045 std <u0044
1669 std <u0042 2046 std <u0042
1702 leax -$01,x 2079 leax -$01,x
1703 ldb #$17 2080 ldb #$17
1704 lbsr L02FA 2081 lbsr L02FA
1705 leas $02,s 2082 leas $02,s
1706 L0DB8 rts 2083 L0DB8 rts
1707 lbsr L0BE4 2084 L0DB9 lbsr L0BE4
1708 std <u0044 2085 std <u0044
1709 lbra L0BC0 2086 lbra L0BC0
1710 ldb <u002B 2087 L0DC1 ldb <u002B
1711 andb #$08 2088 andb #$08
1712 orb #$10 2089 orb #$10
1713 stb <u002B 2090 stb <u002B
1714 lbsr L01F2 2091 lbsr L01F2
1715 lbsr L156C 2092 lbsr L156C
1716 bcc L0DD3 2093 bcc L0DD3
1717 leas $04,s 2094 leas $04,s
1718 L0DD3 rts 2095 L0DD3 rts
1719 ldb #$27 2096 L0DD4 ldb #$27
1720 ldu <u000A 2097 ldu <u000A
1721 L0DD8 lbsr L1164 2098 L0DD8 lbsr L1164
1722 lda <u003E 2099 lda <u003E
1723 bne L0DE3 2100 bne L0DE3
1724 lda ,u 2101 lda ,u
1735 L0DF4 clr ,u 2112 L0DF4 clr ,u
1736 leax -$01,x 2113 leax -$01,x
1737 ldb #$30 2114 ldb #$30
1738 stb <u002B 2115 stb <u002B
1739 L0DFC rts 2116 L0DFC rts
1740 ldb #$4F 2117 L0DFD ldb #$4F
1741 ldu <u0008 2118 ldu <u0008
1742 bra L0DD8 2119 bra L0DD8
1743 lbsr L1408 2120 L0E03 lbsr L1408
1744 L0E06 leas $02,s 2121 L0E06 leas $02,s
1745 rts 2122 rts
1746 bsr L0E21 2123 L0E09 bsr L0E21
1747 bcc L0E12 2124 bcc L0E12
1748 ldb #$30 2125 ldb #$30
1749 stb <u002B 2126 stb <u002B
1750 rts 2127 rts
1751 L0E12 stb ,-s 2128 L0E12 stb ,-s
1756 L0E1D leas $01,s 2133 L0E1D leas $01,s
1757 bra L0E06 2134 bra L0E06
1758 L0E21 lbsr L10B4 2135 L0E21 lbsr L10B4
1759 bcc L0E2B 2136 bcc L0E2B
1760 lbsr L02FA 2137 lbsr L02FA
1761 orcc #Carry 2138 orcc #$01
1762 L0E2B rts 2139 L0E2B rts
1763 L0E2C ldb #$30 2140 L0E2C ldb #$30
1764 stb <u002B 2141 stb <u002B
1765 lbsr L1164 2142 lbsr L1164
1766 L0E33 clr ,-s 2143 L0E33 clr ,-s Clear flag?
1767 lda ,x+ 2144 lda ,x+ Get char
1768 cmpa #$2D 2145 cmpa #'- Dash?
1769 bne L0E3F 2146 bne L0E3F No, leave flag clear
1770 com ,s 2147 com ,s Set flag
1771 lda ,x+ 2148 lda ,x+ Get next char
1772 L0E3F leau <L0EA3,pcr 2149 L0E3F leau <L0EA3,pc Point to table
1773 ldb #$08 2150 ldb #08 # of entries
1774 cmpa #$61 2151 cmpa #'a Is char lowercase?
1775 bcs L0E4A 2152 blo L0E4A No, no conversion needed
1776 suba #$20 2153 suba #$20 Bump down to uppercase
1777 L0E4A cmpa ,u++ 2154 L0E4A cmpa ,u++ Same as first 1/2 of table entry?
1778 beq L0E68 2155 beq L0E68 Yes, skip ahead
1779 decb 2156 decb No, decrement # entries left
1780 bne L0E4A 2157 bne L0E4A Keep checking all 8
1781 puls b 2158 puls b
1782 cmpa #$44 2159 cmpa #'D
1783 beq L0E88 2160 beq L0E88
1784 cmpa #$57 2161 cmpa #'W
1785 beq L0E80 2162 beq L0E80
1786 cmpa #$4C 2163 cmpa #'L
1787 beq L0E90 2164 beq L0E90
1788 cmpa #$4E 2165 cmpa #'N
1789 beq L0E9B 2166 beq L0E9B
1790 L0E63 ldb #$16 2167 L0E63 ldb #$16
1791 lbra L02FA 2168 lbra L02FA
1792 L0E68 ldb -u0001,u 2169 L0E68 ldb -1,u
1793 tfr dp,a 2170 tfr dp,a
1794 tfr d,u 2171 tfr d,u
1795 puls a 2172 puls a
1796 coma 2173 coma
1797 sta ,u 2174 sta ,u
1798 L0E73 lda ,x+ 2175 L0E73 lda ,x+
1799 cmpa #$2C 2176 cmpa #',
1800 beq L0E33 2177 beq L0E33
1801 cmpa #$20 2178 cmpa #$20 Space?
1802 beq L0E2C 2179 beq L0E2C
1803 leax -$01,x 2180 leax -$01,x
1804 rts 2181 rts
1805 L0E80 bsr L0E21 2182 L0E80 bsr L0E21
1806 bcs L0E63 2183 bcs L0E63
1818 bra L0E73 2195 bra L0E73
1819 L0E9B inc <u0060 2196 L0E9B inc <u0060
1820 lda #$1F 2197 lda #$1F
1821 sta <u0037 2198 sta <u0037
1822 bra L0E97 2199 bra L0E97
1823 L0EA3 coma 2200
1824 clrb 2201 * Table: 2 byte entries
1825 rora 2202 L0EA3 fcb $43,$5f
1826 rolb 2203 fcb $46,$59
1827 tsta 2204 fcb $4d,$5a
1828 decb 2205 fcb $47,$5b
1829 asra 2206 fcb $45,$5c
1830 fcb $5B [ 2207 fcb $53,$5e
1831 fcb $45 E 2208 fcb $49,$5d
1832 incb 2209 fcb $4f,$58
1833 comb 2210
1834 fcb $5E ^ 2211 L0EB3 lbsr L12F7
1835 rola
1836 tstb
1837 clra
1838 lslb
1839 lbsr L12F7
1840 bcs L0EBA 2212 bcs L0EBA
1841 stb <u003F 2213 stb <u003F
1842 L0EBA clra 2214 L0EBA clra
1843 std <u0044 2215 std <u0044
1844 ldb #$31 2216 ldb #$31
1845 stb <u002B 2217 stb <u002B
1846 inc <u002C 2218 inc <u002C
1847 rts 2219 rts
1848 lbsr L1164 2220 L0EC4 lbsr L1164
1849 lbsr L15FB 2221 lbsr L15FB
1850 bra L0ECE 2222 bra L0ECE
1851 L0ECC leax -$01,x 2223 L0ECC leax -$01,x
1852 L0ECE ldb -$01,x 2224 L0ECE ldb -$01,x
1853 cmpb #$20 2225 cmpb #$20
1858 stu <u001F 2230 stu <u001F
1859 sta <u0018 2231 sta <u0018
1860 ldb #$30 2232 ldb #$30
1861 stb <u002B 2233 stb <u002B
1862 rts 2234 rts
1863 bsr L0F0F 2235 L0EE3 bsr L0F0F
1864 bne L0F0C 2236 bne L0F0C
1865 rts 2237 rts
1866 bsr L0F0F 2238 L0EE8 bsr L0F0F
1867 beq L0F0C 2239 beq L0F0C
1868 rts 2240 rts
1869 bsr L0F0F 2241 L0EED bsr L0F0F
1870 bge L0F0C 2242 bge L0F0C
1871 rts 2243 rts
1872 bsr L0F0F 2244 L0EF2 bsr L0F0F
1873 bgt L0F0C 2245 bgt L0F0C
1874 rts 2246 rts
1875 bsr L0F0F 2247 L0EF7 bsr L0F0F
1876 blt L0F0C 2248 blt L0F0C
1877 rts 2249 rts
1878 bsr L0F0F 2250 L0EFC bsr L0F0F
1879 ble L0F0C 2251 ble L0F0C
1880 rts 2252 rts
1881 inc <u0055 2253 L0F01 inc <u0055
1882 ldb #$10 2254 ldb #$10
1883 bsr L0F21 2255 bsr L0F21
1884 lda <u003E 2256 lda <u003E
1885 bne L0F0C 2257 bne L0F0C
1886 rts 2258 rts
1889 L0F0F inc <u0055 2261 L0F0F inc <u0055
1890 ldb #$30 2262 ldb #$30
1891 bsr L0F21 2263 bsr L0F21
1892 lbsr L12F1 2264 lbsr L12F1
1893 bcc L0F1C 2265 bcc L0F1C
1894 puls pc,b,a 2266 puls pc,d
1895 L0F1C cmpd #$0000 2267 L0F1C cmpd #$0000
1896 rts 2268 rts
2269
1897 L0F21 tst <u005F 2270 L0F21 tst <u005F
1898 bne L0F26 2271 bne L0F26
1899 clrb 2272 clrb
1900 L0F26 stb <u002B 2273 L0F26 stb <u002B
1901 rts 2274 rts
1902 ldb #$10 2275
2276 L0F29 ldb #$10
1903 bsr L0F21 2277 bsr L0F21
1904 lda <u0055 2278 lda <u0055
1905 beq L0F42 2279 beq L0F42
1906 lda <u0062 2280 lda <u0062
1907 bne L0F3B 2281 bne L0F3B
1953 ldd <u0040 2327 ldd <u0040
1954 cmpd $09,x 2328 cmpd $09,x
1955 beq L0F9E 2329 beq L0F9E
1956 std $09,x 2330 std $09,x
1957 ldb #$0A 2331 ldb #$0A
1958 L0F9A orcc #Carry 2332 L0F9A orcc #$01
1959 puls pc,u,y,x 2333 puls pc,u,y,x
1960 L0F9E andcc #^Carry 2334 L0F9E andcc #$FE
1961 puls pc,u,y,x 2335 puls pc,u,y,x
1962 L0FA2 pshs u,y,x 2336 L0FA2 pshs u,y,x
1963 bsr L0FC3 2337 bsr L0FC3
1964 ldb <u003E 2338 ldb <u003E
1965 bne L0FBB 2339 bne L0FBB
2000 ldx $0B,y 2374 ldx $0B,y
2001 bne L0FCD 2375 bne L0FCD
2002 bra L0FF7 2376 bra L0FF7
2003 L0FF3 ldx $0D,y 2377 L0FF3 ldx $0D,y
2004 bne L0FCD 2378 bne L0FCD
2005 L0FF7 orcc #Carry 2379 L0FF7 orcc #$01
2006 rts 2380 rts
2007 L0FFA ldx <u0016 2381 L0FFA ldx <u0016
2008 ldb ,x 2382 ldb ,x
2009 ldx <u0010 2383 ldx <u0010
2010 subb #$41 2384 subb #$41
2074 bls L107F 2448 bls L107F
2075 addb #$07 2449 addb #$07
2076 L107F addb #$30 2450 L107F addb #$30
2077 stb ,x+ 2451 stb ,x+
2078 rts 2452 rts
2453 * Take number in D and convert to 5 digit ASCII string (stored at X)
2079 L1084 pshs u,y,b 2454 L1084 pshs u,y,b
2080 leau >L10AA,pcr 2455 leau >L10AA,pc Point to powers of 10 table
2081 ldy #$0005 2456 ldy #$0005 5 entries (1-10000)
2082 L108E clr ,s 2457 L108E clr ,s Clear flag
2083 L1090 subd ,u 2458 L1090 subd ,u Repeated subtract
2084 bcs L1098 2459 blo L1098
2085 inc ,s 2460 inc ,s Set flag to 1
2086 bra L1090 2461 bra L1090
2087 L1098 addd ,u++ 2462 L1098 addd ,u++
2088 pshs b 2463 pshs b
2089 ldb $01,s 2464 ldb $01,s
2090 addb #$30 2465 addb #$30 Make into ASCII #
2091 stb ,x+ 2466 stb ,x+
2092 puls b 2467 puls b
2093 leay -$01,y 2468 leay -$01,y
2094 bne L108E 2469 bne L108E
2095 puls pc,u,y,b 2470 puls pc,u,y,b
2096 L10AA fdb $2710 2471 * Subtraction table for ASCII conversion
2097 fdb $03E8 2472 L10AA fdb 10000
2098 fdb $0064 2473 fdb 1000
2099 fdb $000A 2474 fdb 100
2100 fdb $0001 2475 fdb 10
2476 fdb 1
2101 L10B4 lbsr L1164 2477 L10B4 lbsr L1164
2102 leax $01,x 2478 leax $01,x
2103 cmpa #$25 2479 cmpa #$25
2104 beq L111D 2480 beq L111D
2105 cmpa #$24 2481 cmpa #$24
2177 L113B ldb ,x+ 2553 L113B ldb ,x+
2178 cmpb #$30 2554 cmpb #$30
2179 bcs L1145 2555 bcs L1145
2180 cmpb #$39 2556 cmpb #$39
2181 bls L1148 2557 bls L1148
2182 L1145 orcc #Carry 2558 L1145 orcc #$01
2183 rts 2559 rts
2184 L1148 subb #$30 2560 L1148 subb #$30
2185 andcc #^Carry 2561 andcc #$FE
2186 rts 2562 rts
2187 L114D leax -$01,x 2563 L114D leax -$01,x
2188 tst $01,s 2564 tst $01,s
2189 beq L1159 2565 beq L1159
2190 ldd $02,s 2566 ldd $02,s
2191 andcc #^Carry 2567 andcc #$FE
2192 bra L115D 2568 bra L115D
2193 L1159 orcc #Zero 2569 L1159 orcc #$04
2194 L115B orcc #Carry 2570 L115B orcc #$01
2195 L115D leas $04,s 2571 L115D leas $04,s
2196 rts 2572 rts
2197 L1160 andcc #^Zero 2573 L1160 andcc #$FB
2198 bra L115B 2574 bra L115B
2199 L1164 lda ,x+ 2575
2200 cmpa #$20 2576 * Find next text field
2201 beq L1164 2577 * Entry: X=Ptr to current location in source line
2202 leax -$01,x 2578 * Exit: X=Ptr to start of next field in source line
2203 rts 2579 * A=First char in new field
2204 L116D pshs x,b,a 2580 L1164 lda ,x+ Get char.
2581 cmpa #$20 Space?
2582 beq L1164 Yes, eat it
2583 leax -$01,x Found next field; point to it & return
2584 rts
2585
2586 L116D pshs x,d
2205 lda $03,s 2587 lda $03,s
2206 mul 2588 mul
2207 pshs b,a 2589 pshs b,a
2208 lda $02,s 2590 lda $02,s
2209 ldb $05,s 2591 ldb $05,s
2220 leas $06,s 2602 leas $06,s
2221 rts 2603 rts
2222 L118E pshs y,x,b,a 2604 L118E pshs y,x,b,a
2223 ldd ,s 2605 ldd ,s
2224 bne L1198 2606 bne L1198
2225 orcc #Carry 2607 orcc #$01
2226 bra L11B8 2608 bra L11B8
2227 L1198 ldd #$0010 2609 L1198 ldd #$0010
2228 stb $04,s 2610 stb $04,s
2229 clrb 2611 clrb
2230 L119E lsl $03,s 2612 L119E lsl $03,s
2238 L11AC addd ,s 2620 L11AC addd ,s
2239 L11AE dec $04,s 2621 L11AE dec $04,s
2240 bne L119E 2622 bne L119E
2241 tfr d,x 2623 tfr d,x
2242 ldd $02,s 2624 ldd $02,s
2243 andcc #^Carry 2625 andcc #$FE
2244 L11B8 leas $06,s 2626 L11B8 leas $06,s
2245 rts 2627 rts
2246 L11BB sta ,x+ 2628 L11BB sta ,x+
2247 L11BD lda ,y+ 2629 L11BD lda ,y+
2248 bne L11BB 2630 bne L11BB
2249 rts 2631 rts
2250 L11C2 pshs u,y 2632
2251 leau ,s 2633 L11C2 pshs u,y Preserve regs
2252 bsr L1164 2634 leau ,s Point U to copy of Y on stack
2253 bsr L11D0 2635 bsr L1164 Parse for next field
2254 andcc #^Carry 2636 bsr L11D0 Check for special chars
2255 puls pc,u,y 2637 andcc #$FE Error flag off
2256 L11CE leax $01,x 2638 puls pc,u,y Restore regs & return
2639
2640 L11CE leax 1,x
2257 L11D0 bsr L1211 2641 L11D0 bsr L1211
2258 pshs b,a 2642 pshs d
2259 L11D4 lda ,x 2643 L11D4 lda ,x
2260 cmpa #$2D 2644 cmpa #'-
2261 bne L11E2 2645 bne L11E2
2262 bsr L120F 2646 bsr L120F
2263 nega 2647 nega
2264 negb 2648 negb
2265 sbca #$00 2649 sbca #$00
2282 beq L120D 2666 beq L120D
2283 cmpa #$5D 2667 cmpa #$5D
2284 beq L120D 2668 beq L120D
2285 L1205 ldb #$06 2669 L1205 ldb #$06
2286 L1207 leas ,u 2670 L1207 leas ,u
2287 orcc #Carry 2671 orcc #$01
2288 puls pc,u,y 2672 puls pc,u,y
2289 L120D puls pc,b,a 2673 L120D puls pc,d
2290 L120F leax $01,x 2674 L120F leax 1,x
2675
2291 L1211 bsr L123F 2676 L1211 bsr L123F
2292 pshs b,a 2677 pshs d
2678
2293 L1215 lda ,x 2679 L1215 lda ,x
2294 cmpa #$2F 2680 cmpa #'/
2295 bne L122A 2681 bne L122A
2296 bsr L123D 2682 bsr L123D
2297 pshs x 2683 pshs x
2298 ldx $02,s 2684 ldx $02,s
2299 lbsr L118E 2685 lbsr L118E
2300 bcc L1237 2686 bcc L1237
2301 ldb #$04 2687 ldb #$04
2302 bra L1207 2688 bra L1207
2303 L122A cmpa #$2A 2689 L122A cmpa #'*
2304 bne L120D 2690 bne L120D
2305 bsr L123D 2691 bsr L123D
2306 pshs x 2692 pshs x
2307 ldx $02,s 2693 ldx $02,s
2308 lbsr L116D 2694 lbsr L116D
2309 L1237 puls x 2695 L1237 puls x
2310 std ,s 2696 std ,s
2311 bra L1215 2697 bra L1215
2312 L123D leax $01,x 2698 L123D leax $01,x
2699
2313 L123F bsr L126D 2700 L123F bsr L126D
2314 pshs b,a 2701 pshs d
2315 L1243 lda ,x 2702 L1243 lda ,x
2316 cmpa #$26 2703 cmpa #'& Logical AND?
2317 bne L1251 2704 bne L1251 No, check next
2318 bsr L126B 2705 bsr L126B
2319 andb $01,s 2706 andb $01,s
2320 anda ,s 2707 anda ,s
2321 bra L1267 2708 bra L1267
2322 L1251 cmpa #$21 2709 L1251 cmpa #'! Logical OR?
2323 bne L125D 2710 bne L125D No, check next
2324 bsr L126B 2711 bsr L126B
2325 orb $01,s 2712 orb $01,s
2326 ora ,s 2713 ora ,s
2327 bra L1267 2714 bra L1267
2328 L125D cmpa #$3F 2715 L125D cmpa #'? ???
2329 bne L120D 2716 bne L120D
2330 bsr L126B 2717 bsr L126B
2331 eorb $01,s 2718 eorb $01,s
2332 eora ,s 2719 eora ,s
2333 L1267 std ,s 2720 L1267 std ,s
2334 bra L1243 2721 bra L1243
2335 L126B leax $01,x 2722 L126B leax 1,x Bump src code ptr up by 1
2336 L126D lda ,x 2723 L126D lda ,x Get char from source code
2337 cmpa #$5E 2724 cmpa #'^ Is it a NOT?
2338 bne L1279 2725 bne L1279 No, check next
2339 bsr L1284 2726 bsr L1284
2340 comb 2727 comb
2341 coma 2728 coma
2342 bra L1283 2729 bra L1283
2343 L1279 cmpa #$2D 2730 L1279 cmpa #'- Is it negative?
2344 bne L1286 2731 bne L1288 No, check next
2345 bsr L1284 2732 bsr L1284
2346 nega 2733 nega
2347 negb 2734 negb
2348 sbca #$00 2735 sbca #$00
2349 L1283 rts 2736 L1283 rts
2350 L1284 leax $01,x 2737 L1284 leax 1,x
2351 L1286 lda ,x 2738 L1286 lda ,x Get character from source code
2352 cmpa #$28 2739 L1288 cmpa #'( Math grouping start symbol?
2353 bne L12A2 2740 bne L12A2 No, check next
2354 lbsr L11CE 2741 lbsr L11CE
2355 pshs b,a 2742 pshs d
2356 lda ,x 2743 lda ,x
2357 cmpa #$29 2744 cmpa #') Math grouping end symbol?
2358 puls b,a 2745 puls d
2359 beq L12B6 2746 beq L12B6
2360 ldb <u0007 2747 ldb <u0007
2361 bra L129D 2748 bra L129D
2362 L129D leas $02,s 2749 L129D leas $02,s
2363 L129F lbra L1207 2750 L129F lbra L1207
2364 L12A2 cmpa #$2A 2751 L12A2 cmpa #'* Multiply?
2365 bne L12AA 2752 bne L12AA No, check next
2366 ldd <u0040 2753 ldd <u0040
2367 bra L12B6 2754 bra L12B6
2368 L12AA tst <u005A 2755 L12AA tst <u005A If some flag is set, check next
2369 bne L12B9 2756 bne L12B9
2370 cmpa #$2E 2757 cmpa #'. Period?
2371 bne L12B9 2758 bne L12B9 No, check next
2372 ldd <u0042 2759 ldd <u0042
2373 inc <u002C 2760 inc <u002C
2374 L12B6 leax $01,x 2761 L12B6 leax 1,x Bump src code ptr up & return
2375 rts 2762 rts
2376 L12B9 cmpa #$27 2763 L12B9 cmpa #$27 Tilde (') (eorr)?
2377 bne L12C5 2764 bne L12C5 No, check next
2378 ldd ,x++ 2765 ldd ,x++
2379 cmpb #$0D 2766 cmpb #$0D
2380 beq L12D6 2767 beq L12D6
2381 clra 2768 clra
2382 rts 2769 rts
2383 L12C5 cmpa #$22 2770 L12C5 cmpa #'" Quotes?
2384 bne L12D9 2771 bne L12D9 No, check next
2385 leax $01,x 2772 leax 1,x
2386 ldd ,x++ 2773 ldd ,x++
2387 cmpa #$0D 2774 cmpa #$0D
2388 beq L12D6 2775 beq L12D6
2389 cmpb #$0D 2776 cmpb #$0D
2390 beq L12D6 2777 beq L12D6
2397 bra L129F 2784 bra L129F
2398 L12E4 lbsr L0368 2785 L12E4 lbsr L0368
2399 bcs L12D6 2786 bcs L12D6
2400 lbsr L0FA2 2787 lbsr L0FA2
2401 bcs L129F 2788 bcs L129F
2402 L12EE andcc #^Carry 2789 L12EE andcc #$FE
2403 rts 2790 rts
2791 * Called by index mode handler
2404 L12F1 lbsr L11C2 2792 L12F1 lbsr L11C2
2405 bcs L1304 2793 bcs L1304
2406 L12F6 rts 2794 L12F6 rts
2407 L12F7 lbsr L11C2 2795 L12F7 lbsr L11C2
2408 bcs L1304 2796 bcs L1304
2409 tsta 2797 tsta
2410 beq L12F6 2798 beq L12F6
2411 inca 2799 inca
2412 beq L12F6 2800 beq L12F6
2413 ldb #$0E 2801 ldb #$0E Result >255 error
2414 L1304 lbsr L02FA 2802 L1304 lbsr L02FA
2415 ldd #$FFFF 2803 ldd #$FFFF
2416 orcc #Carry 2804 orcc #$01
2417 rts 2805 rts
2418 L130D bsr L134D 2806 L130D bsr L134D
2419 pshs x,b,a 2807 pshs x,d
2420 ldx <u001B 2808 ldx <u001B
2421 sta ,x+ 2809 sta ,x+
2422 stx <u001B 2810 stx <u001B
2423 cmpx <u0010 2811 cmpx <u0010
2424 bcs L1321 2812 bcs L1321
2425 bsr L1323 2813 bsr L1323
2426 ldx <u000E 2814 ldx <u000E
2427 stx <u001B 2815 stx <u001B
2428 L1321 puls pc,x,b,a 2816 L1321 puls pc,x,d
2429 L1323 pshs y,x,b,a 2817 L1323 pshs y,x,d
2430 lda <u0058 2818 lda <u0058
2431 beq L1340 2819 beq L1340
2432 lda <u003E 2820 lda <u003E
2433 beq L1340 2821 beq L1340
2434 ldd <u001B 2822 ldd <u001B
2438 ldx <u000E 2826 ldx <u000E
2439 lda <u0019 2827 lda <u0019
2440 beq L1340 2828 beq L1340
2441 os9 I$Write 2829 os9 I$Write
2442 bcs L1342 2830 bcs L1342
2443 L1340 puls pc,y,x,b,a 2831 L1340 puls pc,y,x,d
2444 L1342 os9 F$PErr 2832 L1342 os9 F$PErr
2445 ldb #$12 2833 ldb #$12
2446 lbsr L02FA 2834 lbsr L02FA
2447 lbra L15A2 2835 lbra L15A2
2448 L134D pshs u,y,x,b,a 2836 L134D pshs u,y,x,d
2449 leax ,s 2837 leax ,s
2450 ldy #$0001 2838 ldy #$0001
2451 tfr dp,a 2839 tfr dp,a
2452 ldb #$51 2840 ldb #$51
2453 tfr d,u 2841 tfr d,u
2454 os9 F$CRC 2842 os9 F$CRC
2455 puls pc,u,y,x,b,a 2843 puls pc,u,y,x,d
2456 L1360 ldd #$FFFF 2844 L1360 ldd #$FFFF
2457 std <u0051 2845 std <u0051
2458 stb <u0053 2846 stb <u0053
2459 rts 2847 rts
2460 L1368 lda <u0057 2848 L1368 lda <u0057
2512 lda $02,s 2900 lda $02,s
2513 bsr L13F7 2901 bsr L13F7
2514 stb ,x+ 2902 stb ,x+
2515 lda ,s 2903 lda ,s
2516 * 1900-2155 fix 2904 * 1900-2155 fix
2905 * ++START++
2517 cmpa #100 2906 cmpa #100
2518 blo L1900 2907 blo L1900
2519 suba #100 2908 suba #100
2520 cmpa #100 2909 cmpa #100
2521 blo L2000 2910 blo L2000
2528 bra PrtCty 2917 bra PrtCty
2529 L1900 pshs a 2918 L1900 pshs a
2530 lda #19 2919 lda #19
2531 PrtCty bsr L13F7 2920 PrtCty bsr L13F7
2532 puls a 2921 puls a
2922 * ++END++
2533 bsr L13F7 2923 bsr L13F7
2534 bsr L13F2 2924 bsr L13F2
2535 lda $03,s 2925 lda $03,s
2536 bsr L13F7 2926 bsr L13F7
2537 ldb #$3A 2927 ldb #$3A
2538 stb ,x+ 2928 stb ,x+
2539 lda $04,s minute 2929 lda $04,s
2540 bsr L13F7 2930 bsr L13F7
2541 stb ,x+ 2931 stb ,x+
2542 lda $05,s 2932 lda $05,s
2543 bsr L13F7 2933 bsr L13F7
2544 L13F0 leas $06,s 2934 L13F0 leas $06,s
2569 stx <u0004 2959 stx <u0004
2570 ldb <u0036 2960 ldb <u0036
2571 subb #$04 2961 subb #$04
2572 stb <u0035 2962 stb <u0035
2573 lbsr L01E5 2963 lbsr L01E5
2574 leay <L14A5,pcr 2964 leay <L14A5,pc Point to 'Microware OS-9 Assembler' etc.
2575 lbsr L11BD 2965 lbsr L11BD
2576 lbsr L13BD 2966 lbsr L13BD
2577 ldx <u0004 2967 ldx <u0004
2578 clra 2968 clra
2579 ldb <u0037 2969 ldb <u0037
2583 lbsr L1084 2973 lbsr L1084
2584 inc <u003B 2974 inc <u003B
2585 bne L1447 2975 bne L1447
2586 inc <u003A 2976 inc <u003A
2587 L1447 leax -$08,x 2977 L1447 leax -$08,x
2588 leay <L149F,pcr 2978 leay <L149F,pc Point to 'Page'
2589 lbsr L11BD 2979 lbsr L11BD
2590 leax $03,x 2980 leax $03,x
2591 lbsr L1370 2981 lbsr L1370
2592 ldy <u000A 2982 ldy <u000A
2593 lbsr L11BD 2983 lbsr L11BD
2607 L1476 ldx <u0004 2997 L1476 ldx <u0004
2608 rts 2998 rts
2609 L1479 lda #$0D 2999 L1479 lda #$0D
2610 bra L147F 3000 bra L147F
2611 L147D lda #$0C 3001 L147D lda #$0C
2612 L147F pshs y,x,b,a 3002 L147F pshs y,x,d
2613 lda <u003E 3003 lda <u003E
2614 beq L1498 3004 beq L1498
2615 lda <u0057 3005 lda <u0057
2616 beq L1498 3006 beq L1498
2617 lda <u0056 3007 lda <u0056
2618 bmi L1498 3008 bmi L1498
2619 lda <u001A 3009 lda <u001A
2620 tfr s,x 3010 tfr s,x
2621 ldy #$0001 3011 ldy #$0001
2622 os9 I$WritLn 3012 os9 I$WritLn
2623 L1498 puls pc,y,x,b,a 3013 L1498 puls pc,y,x,d
2624 L149A ldx <u0004 3014 L149A ldx <u0004
2625 lbra L1370 3015 lbra L1370
2626 L149F fcc "Page " 3016
3017 L149F fcc 'Page '
2627 fcb $00 3018 fcb $00
2628 L14A5 fcc "Microware OS-9 Assembler RS Version 01.00.00 " 3019
3020 L14A5 fcc 'Microware OS-9 Assembler RS Version 01.00.00 '
2629 fcb $00 3021 fcb $00
2630 L14D6 fcc " error(s)" 3022 L14D6 fcc ' error(s)'
2631 fcb $00 3023 fcb $00
2632 L14E0 fcc " warning(s)" 3024 L14E0 fcc ' warning(s)'
2633 fcb $00 3025 fcb $00
2634 L14EC fcc " program bytes generated" 3026 L14EC fcc ' program bytes generated'
2635 fcb $00 3027 fcb $00
2636 L1505 fcc " data bytes allocated" 3028 L1505 fcc ' data bytes allocated'
2637 fcb $00 3029 fcb $00
2638 L151B fcc " bytes used for symbols" 3030 L151B fcc ' bytes used for symbols'
2639 fcb $00 3031 fcb $00
2640 L1533 fcc "ASM:" 3032 L1533 fcc 'ASM:'
2641 L1537 pshs u,y,x,b,a 3033
3034 L1537 pshs u,y,x,d
2642 lda <u005D 3035 lda <u005D
2643 beq L1549 3036 beq L1549
2644 leax <L1533,pcr 3037 leax <L1533,pc Point to 'ASM:'
2645 ldy #$0004 3038 ldy #$0004 Size of text
2646 lda <u001A 3039 lda <u001A Get output path #
2647 os9 I$Write 3040 os9 I$Write Write it out
2648 L1549 ldx <u0000 3041 L1549 ldx <u0000
2649 ldy #$0078 3042 ldy #$0078
2650 lda <u0018 3043 lda <u0018
2651 L1551 os9 I$ReadLn 3044 L1551 os9 I$ReadLn
2652 bcc L156A 3045 bcc L156A
2657 L155E bra L156A 3050 L155E bra L156A
2658 L1560 os9 F$PErr 3051 L1560 os9 F$PErr
2659 ldb #$11 3052 ldb #$11
2660 lbsr L02FA 3053 lbsr L02FA
2661 bsr L156C 3054 bsr L156C
2662 L156A puls pc,u,y,x,b,a 3055 L156A puls pc,u,y,x,d
2663 L156C ldu <u001F 3056 L156C ldu <u001F
2664 L156E cmpu <u0006 3057 L156E cmpu <u0006
2665 bne L1576 3058 bne L1576
2666 orcc #Carry 3059 orcc #$01
2667 rts 3060 rts
2668 L1576 lda <u0018 3061 L1576 lda <u0018
2669 pulu b 3062 pulu b
2670 stu <u001F 3063 stu <u001F
2671 stb <u0018 3064 stb <u0018
2684 lbsr L11BD 3077 lbsr L11BD
2685 lbra L1368 3078 lbra L1368
2686 L159F lbsr L1323 3079 L159F lbsr L1323
2687 L15A2 lbsr L149A 3080 L15A2 lbsr L149A
2688 ldd <u0028 3081 ldd <u0028
2689 leau >L14D6,pcr 3082 leau >L14D6,pc
2690 bsr L1594 3083 bsr L1594
2691 ldd <u0022 3084 ldd <u0022
2692 leau >L14E0,pcr 3085 leau >L14E0,pc
2693 bsr L1594 3086 bsr L1594
2694 ldd <u0024 3087 ldd <u0024
2695 leau >L14EC,pcr 3088 leau >L14EC,pc
2696 bsr L1587 3089 bsr L1587
2697 ldd <u0026 3090 ldd <u0026
2698 leau >L1505,pcr 3091 leau >L1505,pc
2699 bsr L1587 3092 bsr L1587
2700 ldd <u001D 3093 ldd <u001D
2701 subd <u0010 3094 subd <u0010
2702 leau >L151B,pcr 3095 leau >L151B,pc
2703 bsr L1587 3096 bsr L1587
2704 lda <u005E 3097 lda <u005E
2705 beq L15D5 3098 beq L15D5
2706 bsr L1612 3099 bsr L1612
2707 L15D5 lda <u005D 3100 L15D5 lda <u005D
2767 leas $01,s 3160 leas $01,s
2768 lbra L1370 3161 lbra L1370
2769 L165F pshs u,y 3162 L165F pshs u,y
2770 ldd $09,y 3163 ldd $09,y
2771 lbsr L1057 3164 lbsr L1057
2772 lda $08,y 3165 lda $08,y Get offset into table
2773 leau <L1691,pcr 3166 leau <L1691,pc Point to table
2774 lda a,u 3167 lda a,u Get table entry
2775 ldb #$20 3168 ldb #$20 2nd char is a space
2776 std ,x++ 3169 std ,x++ Store both of them
2777 ldb #$08 3170 ldb #$08
2778 L1673 lda ,y+ 3171 L1673 lda ,y+
2779 bne L1679 3172 bne L1679
2780 lda #$20 3173 lda #$20
2781 L1679 sta ,x+ 3174 L1679 sta ,x+
2788 bra L168F 3181 bra L168F
2789 L1688 lbsr L1370 3182 L1688 lbsr L1370
2790 ldb <u003D 3183 ldb <u003D
2791 stb <u003C 3184 stb <u003C
2792 L168F puls pc,u,y 3185 L168F puls pc,u,y
2793 L1691 fcb $55 U 3186
2794 inca 3187 * Single byte entry table
2795 comb 3188 L1691 fcc 'ULSED'
2796 fcb $45 E
2797 lsra
2798 L1696 pshs y,x 3189 L1696 pshs y,x
2799 lbsr L15FB 3190 lbsr L15FB
2800 sta <u0018 3191 sta <u0018
2801 L169D lbsr L1164 3192 L169D lbsr L1164
2802 cmpa #$0D 3193 cmpa #$0D
2828 os9 I$Create 3219 os9 I$Create
2829 ldb #$18 3220 ldb #$18
2830 bcs L16D1 3221 bcs L16D1
2831 sta <u0019 3222 sta <u0019
2832 rts 3223 rts
2833
2834 emod 3224 emod
2835 eom equ * 3225 eom equ *
2836 end
2837