00000000: 3B 55 74 69 6C 69 74 79 00 3B 3D 3D 3D 3D 3D 3D |;Utility.;======|
00000010: 3D 3D 00 44 69 76 69 64 65 00 20 6C 64 61 20 23 |==.Divide. lda #|
00000020: 34 37 00 20 6A 6D 70 20 44 4F 4D 41 54 48 00 4D |47. jmp DOMATH.M|
00000030: 75 6C 74 69 70 6C 79 00 20 6C 64 61 20 23 34 32 |ultiply. lda #42|
00000040: 00 20 6A 6D 70 20 44 4F 4D 41 54 48 00 41 64 64 |. jmp DOMATH.Add|
00000050: 00 20 6C 64 61 20 23 34 33 00 20 6A 6D 70 20 44 |. lda #43. jmp D|
00000060: 4F 4D 41 54 48 00 53 75 62 74 72 61 63 74 00 20 |OMATH.Subtract. |
00000070: 6C 64 61 20 23 34 35 00 20 6A 6D 70 20 44 4F 4D |lda #45. jmp DOM|
00000080: 41 54 48 00 45 71 75 61 6C 00 20 6C 64 61 20 23 |ATH.Equal. lda #|
00000090: 36 31 00 3B 6A 6D 70 00 44 4F 4D 41 54 48 00 20 |61.;jmp.DOMATH. |
000000A0: 4A 53 52 20 4D 41 54 48 00 20 4A 53 52 20 53 57 |JSR MATH. JSR SW|
000000B0: 43 48 4D 4F 44 45 32 00 20 4C 44 41 20 23 30 00 |CHMODE2. LDA #0.|
000000C0: 20 73 74 61 20 4B 65 79 69 6E 6C 65 6E 00 20 52 | sta Keyinlen. R|
000000D0: 54 53 00 44 4F 41 4E 44 00 20 6C 64 61 20 23 27 |TS.DOAND. lda #'|
000000E0: 26 00 20 4A 4D 50 20 44 4F 4D 41 54 48 00 3B 00 |&. JMP DOMATH.;.|
000000F0: 44 4F 4F 52 41 00 20 6C 64 61 20 23 27 7C 00 20 |DOORA. lda #'|. |
00000100: 4A 4D 50 20 44 4F 4D 41 54 48 00 44 4F 45 4F 52 |JMP DOMATH.DOEOR|
00000110: 00 20 6C 64 61 20 23 27 5E 00 20 4A 4D 50 20 44 |. lda #'^. JMP D|
00000120: 4F 4D 41 54 48 00 3B 2D 2D 2D 3D 3D 3D 3D 2D 2D |OMATH.;---====--|
00000130: 2D 3D 3D 3D 2D 2D 2D 2D 2D 00 4F 75 72 47 65 74 |-===-----.OurGet|
00000140: 53 74 72 69 6E 67 00 6C 64 61 20 24 38 35 30 34 |String.lda $8504|
00000150: 00 45 78 69 74 31 00 73 74 61 20 4B 65 79 00 6A |.Exit1.sta Key.j|
00000160: 73 72 20 46 69 6E 64 49 63 6F 6E 4E 75 6D 62 65 |sr FindIconNumbe|
00000170: 72 00 20 6C 64 61 20 6B 65 79 70 72 65 73 73 00 |r. lda keypress.|
00000180: 20 62 6D 69 20 45 78 69 74 31 63 00 20 4A 73 72 | bmi Exit1c. Jsr|
00000190: 20 44 6F 49 63 6F 6E 43 61 6C 6C 00 20 45 78 69 | DoIconCall. Exi|
000001A0: 74 31 63 00 20 6A 73 72 20 47 65 74 4E 65 78 74 |t1c. jsr GetNext|
000001B0: 43 68 61 72 00 20 74 61 78 00 20 62 6E 65 20 45 |Char. tax. bne E|
000001C0: 78 69 74 31 00 52 54 53 00 46 69 6E 64 49 63 6F |xit1.RTS.FindIco|
000001D0: 6E 4E 75 6D 62 65 72 00 20 6C 64 61 20 23 24 46 |nNumber. lda #$F|
000001E0: 46 00 20 73 74 61 20 6B 65 79 70 72 65 73 73 00 |F. sta keypress.|
000001F0: 20 6C 64 78 20 23 30 00 20 4C 70 00 20 6C 64 61 | ldx #0. Lp. lda|
00000200: 20 54 61 62 6C 65 31 2C 78 00 20 62 65 71 20 45 | Table1,x. beq E|
00000210: 78 69 74 32 00 20 63 6D 70 20 4B 65 79 00 20 62 |xit2. cmp Key. b|
00000220: 65 71 20 4F 4B 00 20 69 6E 78 00 20 62 6E 65 20 |eq OK. inx. bne |
00000230: 4C 70 00 4F 4B 00 20 6C 64 61 20 54 61 62 6C 65 |Lp.OK. lda Table|
00000240: 32 2C 58 00 20 73 74 61 20 6B 65 79 70 72 65 73 |2,X. sta keypres|
00000250: 73 00 20 45 78 69 74 32 00 20 52 54 53 00 54 61 |s. Exit2. RTS.Ta|
00000260: 62 6C 65 31 20 2E 42 79 74 65 20 34 38 2C 34 39 |ble1 .Byte 48,49|
00000270: 2C 35 30 2C 35 31 2C 35 32 2C 35 33 2C 35 34 2C |,50,51,52,53,54,|
00000280: 35 35 2C 35 36 2C 35 37 00 20 2E 42 79 74 65 20 |55,56,57. .Byte |
00000290: 39 37 2C 39 38 2C 39 39 2C 31 30 30 2C 31 30 31 |97,98,99,100,101|
000002A0: 2C 31 30 32 00 20 2E 42 79 74 65 20 34 33 2C 34 |,102. .Byte 43,4|
000002B0: 35 2C 34 37 2C 34 32 2C 36 31 2C 33 38 2C 39 34 |5,47,42,61,38,94|
000002C0: 2C 31 32 34 2C 31 38 2C 31 39 2C 32 39 2C 31 2C |,124,18,19,29,1,|
000002D0: 33 2C 35 2C 33 37 2C 33 35 2C 33 36 2C 30 00 54 |3,5,37,35,36,0.T|
000002E0: 61 62 6C 65 32 20 2E 42 79 74 65 20 30 2C 31 2C |able2 .Byte 0,1,|
000002F0: 32 2C 33 2C 34 2C 35 2C 36 2C 37 2C 38 2C 39 00 |2,3,4,5,6,7,8,9.|
00000300: 20 2E 42 79 74 65 20 31 30 2C 31 31 2C 31 32 2C | .Byte 10,11,12,|
00000310: 31 33 2C 31 34 2C 31 35 2C 32 33 2C 32 32 2C 32 |13,14,15,23,22,2|
00000320: 30 2C 32 31 2C 32 34 2C 32 38 2C 32 39 2C 33 30 |0,21,24,28,29,30|
00000330: 2C 31 36 2C 31 37 00 20 2E 42 79 74 65 20 31 38 |,16,17. .Byte 18|
00000340: 2C 32 35 2C 32 36 2C 32 37 2C 33 35 2C 33 36 2C |,25,26,27,35,36,|
00000350: 33 37 00 4B 65 79 20 2E 42 79 74 65 20 30 00 3B |37.Key .Byte 0.;|
00000360: 2D 2D 2D 2D 00 44 6F 49 63 6F 6E 43 61 6C 6C 00 |----.DoIconCall.|
00000370: 20 6A 73 72 20 49 6E 76 65 72 74 00 20 6C 64 61 | jsr Invert. lda|
00000380: 20 6B 65 79 70 72 65 73 73 00 20 63 6D 70 20 23 | keypress. cmp #|
00000390: 31 36 00 20 62 63 73 20 53 6B 69 70 32 32 00 20 |16. bcs Skip22. |
000003A0: 6C 64 61 20 6B 65 79 70 72 65 73 73 00 20 6A 73 |lda keypress. js|
000003B0: 72 20 49 63 6F 6E 43 61 6C 6C 32 00 20 52 54 53 |r IconCall2. RTS|
000003C0: 00 53 6B 69 70 32 32 00 20 63 6D 70 20 23 31 36 |.Skip22. cmp #16|
000003D0: 00 20 62 6E 65 20 73 31 00 20 6A 6D 70 20 43 6C |. bne s1. jmp Cl|
000003E0: 65 61 72 00 73 31 00 20 63 6D 70 20 23 31 37 00 |ear.s1. cmp #17.|
000003F0: 20 62 6E 65 20 73 32 00 20 6A 6D 70 20 43 6C 65 | bne s2. jmp Cle|
00000400: 61 72 41 6C 6C 00 73 32 00 20 63 6D 70 20 23 31 |arAll.s2. cmp #1|
00000410: 38 00 20 62 6E 65 20 73 33 00 20 6A 6D 70 20 44 |8. bne s3. jmp D|
00000420: 65 6C 65 74 65 00 73 33 00 20 63 6D 70 20 23 32 |elete.s3. cmp #2|
00000430: 30 00 20 62 6E 65 20 73 34 00 20 6A 6D 70 20 44 |0. bne s4. jmp D|
00000440: 69 76 69 64 65 00 73 34 00 20 63 6D 70 20 23 32 |ivide.s4. cmp #2|
00000450: 31 00 20 62 6E 65 20 73 35 00 20 6A 6D 70 20 4D |1. bne s5. jmp M|
00000460: 75 6C 74 69 70 6C 79 00 73 35 00 20 63 6D 70 20 |ultiply.s5. cmp |
00000470: 23 32 32 00 20 62 6E 65 20 73 36 00 20 6A 6D 70 |#22. bne s6. jmp|
00000480: 20 53 75 62 74 72 61 63 74 00 73 36 00 20 63 6D | Subtract.s6. cm|
00000490: 70 20 23 32 33 00 20 62 6E 65 20 73 37 00 20 6A |p #23. bne s7. j|
000004A0: 6D 70 20 41 64 64 00 73 37 00 20 63 6D 70 20 23 |mp Add.s7. cmp #|
000004B0: 32 34 00 20 62 6E 65 20 73 38 00 20 6A 6D 70 20 |24. bne s8. jmp |
000004C0: 45 71 75 61 6C 00 73 38 00 20 63 6D 70 20 23 32 |Equal.s8. cmp #2|
000004D0: 35 00 20 62 6E 65 20 73 39 00 20 6A 6D 70 20 53 |5. bne s9. jmp S|
000004E0: 57 49 54 43 48 4D 4F 44 45 32 00 73 39 00 20 63 |WITCHMODE2.s9. c|
000004F0: 6D 70 20 23 32 36 00 20 62 6E 65 20 73 31 30 00 |mp #26. bne s10.|
00000500: 20 6A 6D 70 20 53 57 49 54 43 48 4D 4F 44 45 32 | jmp SWITCHMODE2|
00000510: 00 73 31 30 00 20 63 6D 70 20 23 32 37 00 20 62 |.s10. cmp #27. b|
00000520: 6E 65 20 73 31 31 00 20 6A 6D 70 20 53 57 49 54 |ne s11. jmp SWIT|
00000530: 43 48 4D 4F 44 45 32 00 73 31 31 00 20 63 6D 70 |CHMODE2.s11. cmp|
00000540: 20 23 32 38 00 20 62 6E 65 20 73 31 32 00 20 6A | #28. bne s12. j|
00000550: 6D 70 20 44 4F 41 4E 44 00 73 31 32 00 20 63 6D |mp DOAND.s12. cm|
00000560: 70 20 23 32 39 00 20 62 6E 65 20 73 31 33 00 20 |p #29. bne s13. |
00000570: 6A 6D 70 20 44 4F 45 4F 52 00 73 31 33 00 20 63 |jmp DOEOR.s13. c|
00000580: 6D 70 20 23 33 30 00 20 62 6E 65 20 73 31 34 00 |mp #30. bne s14.|
00000590: 20 6A 6D 70 20 44 4F 4F 52 41 00 73 31 34 00 20 | jmp DOORA.s14. |
000005A0: 63 6D 70 20 23 33 35 00 20 62 63 63 20 73 32 32 |cmp #35. bcc s22|
000005B0: 00 20 63 6D 70 20 23 33 38 00 20 62 63 73 20 73 |. cmp #38. bcs s|
000005C0: 32 32 00 20 73 65 63 00 20 73 62 63 20 23 31 30 |22. sec. sbc #10|
000005D0: 00 20 73 74 61 20 6B 65 79 70 72 65 73 73 00 20 |. sta keypress. |
000005E0: 6A 73 72 20 53 57 49 54 43 48 4D 4F 44 45 32 00 |jsr SWITCHMODE2.|
000005F0: 20 6C 64 78 20 23 30 00 20 73 74 78 20 4B 65 79 | ldx #0. stx Key|
00000600: 69 6E 6C 65 6E 00 20 52 54 53 00 73 32 32 00 72 |inlen. RTS.s22.r|
00000610: 74 73 00 3B 00 49 6E 76 65 72 74 00 20 6A 73 72 |ts.;.Invert. jsr|
00000620: 20 49 6E 76 65 72 74 32 00 20 6C 64 79 20 23 35 | Invert2. ldy #5|
00000630: 38 00 69 6E 76 32 00 20 6C 64 78 20 23 32 35 35 |8.inv2. ldx #255|
00000640: 00 69 6E 76 31 00 20 4E 4F 50 00 20 6E 6F 70 00 |.inv1. NOP. nop.|
00000650: 20 64 65 78 00 20 62 6E 65 20 69 6E 76 31 00 20 | dex. bne inv1. |
00000660: 4E 4F 50 00 20 64 65 79 00 20 62 6E 65 20 69 6E |NOP. dey. bne in|
00000670: 76 32 00 20 6A 73 72 20 49 6E 76 65 72 74 33 00 |v2. jsr Invert3.|
00000680: 20 52 54 53 00 3B 2D 2D 2D 00 78 62 79 74 65 20 | RTS.;---.xbyte |
00000690: 2E 42 79 74 65 20 30 00 79 62 79 74 65 20 2E 42 |.Byte 0.ybyte .B|
000006A0: 79 74 65 20 30 00 49 6E 76 65 72 74 32 00 20 6C |yte 0.Invert2. l|
000006B0: 64 61 20 6B 65 79 70 72 65 73 73 00 20 63 6D 70 |da keypress. cmp|
000006C0: 20 23 33 35 00 20 62 63 63 20 69 6E 76 33 34 00 | #35. bcc inv34.|
000006D0: 20 73 65 63 00 20 73 62 63 20 23 31 30 00 69 6E | sec. sbc #10.in|
000006E0: 76 33 34 00 20 61 73 6C 00 20 74 61 78 00 20 6C |v34. asl. tax. l|
000006F0: 64 61 20 74 61 62 6C 65 75 2C 58 00 20 73 74 61 |da tableu,X. sta|
00000700: 20 78 62 79 74 65 00 20 69 6E 78 00 20 6C 64 61 | xbyte. inx. lda|
00000710: 20 74 61 62 6C 65 75 2C 58 00 20 73 74 61 20 79 | tableu,X. sta y|
00000720: 62 79 74 65 00 49 6E 76 65 72 74 33 00 20 6C 64 |byte.Invert3. ld|
00000730: 61 20 23 30 00 20 73 74 61 20 52 33 2B 31 00 20 |a #0. sta R3+1. |
00000740: 6C 64 61 20 78 62 79 74 65 00 20 61 73 6C 00 20 |lda xbyte. asl. |
00000750: 61 73 6C 00 20 61 73 6C 00 20 73 74 61 20 52 33 |asl. asl. sta R3|
00000760: 00 20 63 6C 63 00 20 61 64 63 20 23 32 33 00 20 |. clc. adc #23. |
00000770: 73 74 61 20 52 34 00 20 6C 64 61 20 52 33 2B 31 |sta R4. lda R3+1|
00000780: 00 20 61 64 63 20 23 30 00 20 73 74 61 20 52 34 |. adc #0. sta R4|
00000790: 2B 31 00 20 6C 64 61 20 79 62 79 74 65 00 20 73 |+1. lda ybyte. s|
000007A0: 74 61 20 52 32 00 20 63 6C 63 00 20 61 64 63 20 |ta R2. clc. adc |
000007B0: 23 31 35 00 20 73 74 61 20 52 32 2B 31 00 20 6A |#15. sta R2+1. j|
000007C0: 73 72 20 49 6E 76 65 72 74 52 65 63 74 61 6E 67 |sr InvertRectang|
000007D0: 6C 65 00 20 52 54 53 00 74 61 62 6C 65 75 00 2E |le. RTS.tableu..|
000007E0: 49 6E 63 6C 75 64 65 20 54 41 42 4C 45 55 00 3B |Include TABLEU.;|
000007F0: 00 3B 00 3B 00 3B 00 00 |.;.;.;.. |
;UTILITY.;========.DIVIDE. LDA #47. JMP
DOMATH.MULTIPLY. LDA #42. JMP DOMATH.ADD
. LDA #43. JMP DOMATH.SUBTRACT. LDA #45.
JMP DOMATH.EQUAL. LDA #61.;JMP.DOMATH.
JSR MATH. JSR SWCHMODE2. LDA #0. STA KEY
INLEN. RTS.DOAND. LDA #'&. JMP DOMATH.;.
DOORA. LDA #'|. JMP DOMATH.DOEOR. LDA #'
^. JMP DOMATH.;---====---===-----.OURGET
STRING.LDA $8504.EXIT1.STA KEY.JSR FINDI
CONNUMBER. LDA KEYPRESS. BMI EXIT1C. JSR
DOICONCALL. EXIT1C. JSR GETNEXTCHAR. TA
X. BNE EXIT1.RTS.FINDICONNUMBER. LDA #$F
F. STA KEYPRESS. LDX #0. LP. LDA TABLE1,
X. BEQ EXIT2. CMP KEY. BEQ OK. INX. BNE
LP.OK. LDA TABLE2,X. STA KEYPRESS. EXIT2
. RTS.TABLE1 .BYTE 48,49,50,51,52,53,54,
55,56,57. .BYTE 97,98,99,100,101,102. .B
YTE 43,45,47,42,61,38,94,124,18,19,29,1,
3,5,37,35,36,0.TABLE2 .BYTE 0,1,2,3,4,5,
6,7,8,9. .BYTE 10,11,12,13,14,15,23,22,2
0,21,24,28,29,30,16,17. .BYTE 18,25,26,2
7,35,36,37.KEY .BYTE 0.;----.DOICONCALL.
JSR INVERT. LDA KEYPRESS. CMP #16. BCS
SKIP22. LDA KEYPRESS. JSR ICONCALL2. RTS
.SKIP22. CMP #16. BNE S1. JMP CLEAR.S1.
CMP #17. BNE S2. JMP CLEARALL.S2. CMP #1
8. BNE S3. JMP DELETE.S3. CMP #20. BNE S
4. JMP DIVIDE.S4. CMP #21. BNE S5. JMP M
ULTIPLY.S5. CMP #22. BNE S6. JMP SUBTRAC
T.S6. CMP #23. BNE S7. JMP ADD.S7. CMP #
24. BNE S8. JMP EQUAL.S8. CMP #25. BNE S
9. JMP SWITCHMODE2.S9. CMP #26. BNE S10.
JMP SWITCHMODE2.S10. CMP #27. BNE S11.
JMP SWITCHMODE2.S11. CMP #28. BNE S12. J
MP DOAND.S12. CMP #29. BNE S13. JMP DOEO
R.S13. CMP #30. BNE S14. JMP DOORA.S14.
CMP #35. BCC S22. CMP #38. BCS S22. SEC.
SBC #10. STA KEYPRESS. JSR SWITCHMODE2.
LDX #0. STX KEYINLEN. RTS.S22.RTS.;.INV
ERT. JSR INVERT2. LDY #58.INV2. LDX #255
.INV1. NOP. NOP. DEX. BNE INV1. NOP. DEY
. BNE INV2. JSR INVERT3. RTS.;---.XBYTE
.BYTE 0.YBYTE .BYTE 0.INVERT2. LDA KEYPR
ESS. CMP #35. BCC INV34. SEC. SBC #10.IN
V34. ASL. TAX. LDA TABLEU,X. STA XBYTE.
INX. LDA TABLEU,X. STA YBYTE.INVERT3. LD
A #0. STA R3+1. LDA XBYTE. ASL. ASL. ASL
. STA R3. CLC. ADC #23. STA R4. LDA R3+1
. ADC #0. STA R4+1. LDA YBYTE. STA R2. C
LC. ADC #15. STA R2+1. JSR INVERTRECTANG
LE. RTS.TABLEU..INCLUDE TABLEU.;.;.;.;..
×
C64 Image
> CLICK IMAGE PREVIEW FOR FULL MODAL