00000000: 3B 20 41 53 43 49 49 00 3B 20 56 41 4C 55 45 20 |; ASCII.; VALUE |
00000010: 49 53 20 54 48 45 20 42 49 4E 41 52 59 20 4E 55 |IS THE BINARY NU|
00000020: 4D 42 45 52 20 43 4F 4E 56 45 52 54 45 44 20 49 |MBER CONVERTED I|
00000030: 4E 54 4F 20 41 53 43 49 49 20 43 4F 44 45 2E 00 |NTO ASCII CODE..|
00000040: 56 41 4C 55 45 20 2E 42 59 54 45 20 30 2C 30 00 |VALUE .BYTE 0,0.|
00000050: 3B 4D 4F 44 20 31 30 20 49 53 20 41 20 54 45 4D |;MOD 10 IS A TEM|
00000060: 50 4F 52 41 52 59 20 57 4F 52 4B 20 41 52 45 41 |PORARY WORK AREA|
00000070: 00 4D 4F 44 31 30 20 2E 42 59 54 45 20 30 2C 30 |.MOD10 .BYTE 0,0|
00000080: 00 4B 65 79 69 6E 6C 65 6E 20 2E 42 59 54 45 20 |.Keyinlen .BYTE |
00000090: 30 00 4B 49 4E 42 55 46 20 2E 42 6C 6F 63 6B 20 |0.KINBUF .Block |
000000A0: 33 32 2C 30 00 44 49 53 4C 45 4E 20 2E 42 59 54 |32,0.DISLEN .BYT|
000000B0: 45 20 30 00 44 58 53 42 55 46 20 2E 42 6C 6F 63 |E 0.DXSBUF .Bloc|
000000C0: 6B 20 33 32 2C 30 00 3B 20 43 4F 4E 56 45 52 53 |k 32,0.; CONVERS|
000000D0: 49 4F 4E 20 52 4F 55 54 49 4E 45 53 00 3B 20 55 |ION ROUTINES.; U|
000000E0: 53 45 44 20 54 4F 20 43 4F 4E 56 45 52 54 20 41 |SED TO CONVERT A|
000000F0: 53 43 49 49 20 43 48 41 52 41 43 54 45 52 53 00 |SCII CHARACTERS.|
00000100: 3B 20 54 4F 20 41 20 57 4F 52 44 20 56 41 4C 55 |; TO A WORD VALU|
00000110: 45 2E 00 3B 20 42 45 46 4F 52 45 20 45 4E 54 52 |E..; BEFORE ENTR|
00000120: 59 20 4D 4F 56 45 20 4E 55 4D 42 45 52 20 54 4F |Y MOVE NUMBER TO|
00000130: 00 3B 20 43 4F 4E 56 45 52 54 20 49 4E 54 4F 20 |.; CONVERT INTO |
00000140: 27 56 41 4C 55 45 27 20 4C 4F 43 41 54 49 4F 4E |'VALUE' LOCATION|
00000150: 00 3B 20 52 45 53 55 4C 54 20 49 53 20 53 54 4F |.; RESULT IS STO|
00000160: 52 45 44 20 49 4E 20 44 58 53 42 55 46 00 3B 20 |RED IN DXSBUF.; |
00000170: 20 41 4E 44 20 4C 45 4E 47 54 48 20 49 53 20 50 | AND LENGTH IS P|
00000180: 4C 41 43 45 44 20 49 4E 20 44 49 53 4C 45 4E 00 |LACED IN DISLEN.|
00000190: 3B 20 43 4F 4E 56 45 52 54 53 20 42 49 4E 41 52 |; CONVERTS BINAR|
000001A0: 59 2C 20 44 45 43 49 4D 41 4C 20 20 41 4E 44 20 |Y, DECIMAL AND |
000001B0: 48 45 58 41 44 45 43 49 4D 41 4C 00 52 45 53 55 |HEXADECIMAL.RESU|
000001C0: 4C 54 20 2E 42 79 74 65 20 30 2C 30 00 3B 3D 3D |LT .Byte 0,0.;==|
000001D0: 3D 3D 3D 3D 3D 00 42 49 4E 32 53 54 00 20 6A 73 |=====.BIN2ST. js|
000001E0: 72 20 6D 6F 76 65 32 76 61 6C 75 65 00 20 4C 44 |r move2value. LD|
000001F0: 41 20 23 30 00 20 54 41 59 00 20 54 41 58 00 20 |A #0. TAY. TAX. |
00000200: 53 54 41 20 44 49 53 4C 45 4E 00 20 53 54 41 20 |STA DISLEN. STA |
00000210: 58 4C 4F 4F 50 00 42 49 4E 4C 50 31 00 20 49 4E |XLOOP.BINLP1. IN|
00000220: 43 20 58 4C 4F 4F 50 00 20 43 4C 43 00 20 41 53 |C XLOOP. CLC. AS|
00000230: 4C 20 56 41 4C 55 45 00 20 52 4F 4C 20 56 41 4C |L VALUE. ROL VAL|
00000240: 55 45 2B 31 00 20 42 43 53 20 4F 4E 45 42 49 4E |UE+1. BCS ONEBIN|
00000250: 00 20 54 59 41 00 20 42 4E 45 20 44 4F 54 5A 45 |. TYA. BNE DOTZE|
00000260: 52 00 20 54 58 41 00 20 42 4E 45 20 44 4F 54 5A |R. TXA. BNE DOTZ|
00000270: 45 52 00 20 4C 44 41 20 58 4C 4F 4F 50 00 20 43 |ER. LDA XLOOP. C|
00000280: 4D 50 20 23 31 36 00 20 42 4E 45 20 42 49 4E 4C |MP #16. BNE BINL|
00000290: 50 31 00 44 4F 54 5A 45 52 00 20 4C 44 41 20 23 |P1.DOTZER. LDA #|
000002A0: 34 38 00 20 53 54 41 20 44 58 53 42 55 46 2C 58 |48. STA DXSBUF,X|
000002B0: 00 20 42 4E 45 20 45 4E 44 4C 4F 50 00 4F 4E 45 |. BNE ENDLOP.ONE|
000002C0: 42 49 4E 20 20 4C 44 41 20 23 34 39 00 20 53 54 |BIN LDA #49. ST|
000002D0: 41 20 44 58 53 42 55 46 2C 58 00 45 4E 44 4C 4F |A DXSBUF,X.ENDLO|
000002E0: 50 00 20 49 4E 58 00 20 4C 44 41 20 58 4C 4F 4F |P. INX. LDA XLOO|
000002F0: 50 00 20 43 4D 50 20 23 31 36 00 20 42 4E 45 20 |P. CMP #16. BNE |
00000300: 42 49 4E 4C 50 31 00 20 53 54 58 20 44 49 53 4C |BINLP1. STX DISL|
00000310: 45 4E 00 20 52 54 53 00 58 4C 4F 4F 50 20 2E 42 |EN. RTS.XLOOP .B|
00000320: 59 54 45 20 30 00 3B 2D 2D 2D 2D 2D 2D 2D 2D 2D |YTE 0.;---------|
00000330: 2D 2A 00 3B 42 53 54 52 49 4E 47 32 42 49 4E 20 |-*.;BSTRING2BIN |
00000340: 43 4F 4E 56 45 52 53 49 4F 4E 20 52 4F 55 54 49 |CONVERSION ROUTI|
00000350: 4E 45 00 53 54 32 42 49 4E 00 20 4C 44 41 20 23 |NE.ST2BIN. LDA #|
00000360: 30 00 20 53 54 41 20 52 45 53 55 4C 54 00 20 53 |0. STA RESULT. S|
00000370: 54 41 20 52 45 53 55 4C 54 2B 31 00 20 54 41 58 |TA RESULT+1. TAX|
00000380: 00 42 49 4E 4C 4F 50 00 20 41 53 4C 20 52 45 53 |.BINLOP. ASL RES|
00000390: 55 4C 54 00 20 52 4F 4C 20 52 45 53 55 4C 54 2B |ULT. ROL RESULT+|
000003A0: 31 00 20 43 4C 43 00 20 4C 44 41 20 4B 49 4E 42 |1. CLC. LDA KINB|
000003B0: 55 46 2C 58 00 20 41 4E 44 20 23 31 00 20 41 44 |UF,X. AND #1. AD|
000003C0: 43 20 52 45 53 55 4C 54 00 20 53 54 41 20 52 45 |C RESULT. STA RE|
000003D0: 53 55 4C 54 00 20 4C 44 41 20 23 30 00 20 41 44 |SULT. LDA #0. AD|
000003E0: 43 20 52 45 53 55 4C 54 2B 31 00 20 53 54 41 20 |C RESULT+1. STA |
000003F0: 52 45 53 55 4C 54 2B 31 00 20 49 4E 58 00 20 43 |RESULT+1. INX. C|
00000400: 50 58 20 4B 65 79 69 6E 6C 65 6E 00 20 42 4E 45 |PX Keyinlen. BNE|
00000410: 20 42 49 4E 4C 4F 50 00 20 52 54 53 00 3B 2D 2D | BINLOP. RTS.;--|
00000420: 2D 2D 2D 2D 2D 2A 00 3B 48 45 58 32 42 49 4E 20 |-----*.;HEX2BIN |
00000430: 43 4F 4E 56 45 52 53 49 4F 4E 20 52 4F 55 54 49 |CONVERSION ROUTI|
00000440: 4E 45 00 48 45 58 42 49 4E 00 20 4C 44 41 20 23 |NE.HEXBIN. LDA #|
00000450: 30 00 20 53 54 41 20 52 45 53 55 4C 54 00 20 53 |0. STA RESULT. S|
00000460: 54 41 20 52 45 53 55 4C 54 2B 31 00 20 54 41 58 |TA RESULT+1. TAX|
00000470: 00 48 45 58 4C 4F 50 00 20 43 4C 43 00 20 41 53 |.HEXLOP. CLC. AS|
00000480: 4C 20 52 45 53 55 4C 54 00 20 52 4F 4C 20 52 45 |L RESULT. ROL RE|
00000490: 53 55 4C 54 2B 31 00 20 41 53 4C 20 52 45 53 55 |SULT+1. ASL RESU|
000004A0: 4C 54 00 20 52 4F 4C 20 52 45 53 55 4C 54 2B 31 |LT. ROL RESULT+1|
000004B0: 00 20 41 53 4C 20 52 45 53 55 4C 54 00 20 52 4F |. ASL RESULT. RO|
000004C0: 4C 20 52 45 53 55 4C 54 2B 31 00 20 41 53 4C 20 |L RESULT+1. ASL |
000004D0: 52 45 53 55 4C 54 00 20 52 4F 4C 20 52 45 53 55 |RESULT. ROL RESU|
000004E0: 4C 54 2B 31 00 20 4C 44 41 20 4B 49 4E 42 55 46 |LT+1. LDA KINBUF|
000004F0: 2C 58 00 20 43 4D 50 20 23 36 35 00 20 42 43 43 |,X. CMP #65. BCC|
00000500: 20 4D 4F 52 48 45 58 00 20 53 45 43 00 20 53 42 | MORHEX. SEC. SB|
00000510: 43 20 23 37 00 4D 4F 52 48 45 58 00 20 41 4E 44 |C #7.MORHEX. AND|
00000520: 20 23 31 35 00 20 43 4C 43 00 20 41 44 43 20 52 | #15. CLC. ADC R|
00000530: 45 53 55 4C 54 00 20 53 54 41 20 52 45 53 55 4C |ESULT. STA RESUL|
00000540: 54 00 20 4C 44 41 20 23 30 00 20 41 44 43 20 52 |T. LDA #0. ADC R|
00000550: 45 53 55 4C 54 2B 31 00 20 53 54 41 20 52 45 53 |ESULT+1. STA RES|
00000560: 55 4C 54 2B 31 00 20 49 4E 58 00 20 43 50 58 20 |ULT+1. INX. CPX |
00000570: 4B 65 79 69 6E 6C 65 6E 00 20 42 4E 45 20 48 45 |Keyinlen. BNE HE|
00000580: 58 4C 4F 50 00 20 52 54 53 00 3B 2D 2D 2D 2D 2D |XLOP. RTS.;-----|
00000590: 2D 2D 2D 2A 00 42 49 4E 48 45 58 00 6A 73 72 20 |---*.BINHEX.jsr |
000005A0: 6D 6F 76 65 32 76 61 6C 75 65 00 20 4C 44 41 20 |move2value. LDA |
000005B0: 23 30 00 20 53 54 41 20 44 49 53 4C 45 4E 00 20 |#0. STA DISLEN. |
000005C0: 54 41 58 00 20 4C 44 41 20 56 41 4C 55 45 2B 31 |TAX. LDA VALUE+1|
000005D0: 00 20 42 45 51 20 4C 4F 57 42 59 54 00 20 4C 53 |. BEQ LOWBYT. LS|
000005E0: 52 00 20 4C 53 52 00 20 4C 53 52 00 20 4C 53 52 |R. LSR. LSR. LSR|
000005F0: 00 20 54 41 59 00 20 42 45 51 20 54 48 45 48 45 |. TAY. BEQ THEHE|
00000600: 58 00 20 4C 44 41 20 48 45 58 54 42 4C 2C 59 00 |X. LDA HEXTBL,Y.|
00000610: 20 53 54 41 20 44 58 53 42 55 46 2C 58 00 20 49 | STA DXSBUF,X. I|
00000620: 4E 58 00 54 48 45 48 45 58 20 20 4C 44 41 20 56 |NX.THEHEX LDA V|
00000630: 41 4C 55 45 2B 31 00 20 41 4E 44 20 23 31 35 00 |ALUE+1. AND #15.|
00000640: 20 54 41 59 00 20 4C 44 41 20 48 45 58 54 42 4C | TAY. LDA HEXTBL|
00000650: 2C 59 00 20 53 54 41 20 44 58 53 42 55 46 2C 58 |,Y. STA DXSBUF,X|
00000660: 00 20 49 4E 58 00 4C 4F 57 42 59 54 00 20 4C 44 |. INX.LOWBYT. LD|
00000670: 41 20 56 41 4C 55 45 00 20 4C 53 52 00 20 4C 53 |A VALUE. LSR. LS|
00000680: 52 00 20 4C 53 52 00 20 4C 53 52 00 20 54 41 59 |R. LSR. LSR. TAY|
00000690: 00 20 42 4E 45 20 43 4F 4E 54 32 32 00 20 54 58 |. BNE CONT22. TX|
000006A0: 41 00 20 42 45 51 20 4F 4E 45 48 45 58 00 43 4F |A. BEQ ONEHEX.CO|
000006B0: 4E 54 32 32 00 20 4C 44 41 20 48 45 58 54 42 4C |NT22. LDA HEXTBL|
000006C0: 2C 59 00 20 53 54 41 20 44 58 53 42 55 46 2C 58 |,Y. STA DXSBUF,X|
000006D0: 00 20 49 4E 58 00 4F 4E 45 48 45 58 00 20 4C 44 |. INX.ONEHEX. LD|
000006E0: 41 20 56 41 4C 55 45 00 20 41 4E 44 20 23 31 35 |A VALUE. AND #15|
000006F0: 00 20 54 41 59 00 20 4C 44 41 20 48 45 58 54 42 |. TAY. LDA HEXTB|
00000700: 4C 2C 59 00 20 53 54 41 20 44 58 53 42 55 46 2C |L,Y. STA DXSBUF,|
00000710: 58 00 20 49 4E 58 00 20 53 54 58 20 44 49 53 4C |X. INX. STX DISL|
00000720: 45 4E 00 20 52 54 53 00 48 45 58 54 42 4C 20 2E |EN. RTS.HEXTBL .|
00000730: 42 59 54 45 20 27 30 31 32 33 34 35 36 37 38 39 |BYTE '0123456789|
00000740: 41 42 43 44 45 46 27 00 3B 2D 2D 2D 2D 2D 2D 2D |ABCDEF'.;-------|
00000750: 2D 2D 2A 00 44 45 43 42 49 4E 00 53 54 52 44 45 |--*.DECBIN.STRDE|
00000760: 43 00 20 4C 44 41 20 23 30 00 20 53 54 41 20 52 |C. LDA #0. STA R|
00000770: 45 53 55 4C 54 00 20 53 54 41 20 52 45 53 55 4C |ESULT. STA RESUL|
00000780: 54 2B 31 00 20 54 41 58 00 44 45 43 4C 4F 50 00 |T+1. TAX.DECLOP.|
00000790: 20 43 4C 43 00 20 41 53 4C 20 52 45 53 55 4C 54 | CLC. ASL RESULT|
000007A0: 00 20 52 4F 4C 20 52 45 53 55 4C 54 2B 31 00 20 |. ROL RESULT+1. |
000007B0: 4C 44 41 20 52 45 53 55 4C 54 00 20 4C 44 59 20 |LDA RESULT. LDY |
000007C0: 52 45 53 55 4C 54 2B 31 00 20 41 53 4C 20 52 45 |RESULT+1. ASL RE|
000007D0: 53 55 4C 54 00 20 52 4F 4C 20 52 45 53 55 4C 54 |SULT. ROL RESULT|
000007E0: 2B 31 00 20 41 53 4C 20 52 45 53 55 4C 54 00 20 |+1. ASL RESULT. |
000007F0: 52 4F 4C 20 52 45 53 55 4C 54 2B 31 00 20 43 4C |ROL RESULT+1. CL|
00000800: 43 00 20 41 44 43 20 52 45 53 55 4C 54 00 20 53 |C. ADC RESULT. S|
00000810: 54 41 20 52 45 53 55 4C 54 00 20 54 59 41 00 20 |TA RESULT. TYA. |
00000820: 41 44 43 20 52 45 53 55 4C 54 2B 31 00 20 53 54 |ADC RESULT+1. ST|
00000830: 41 20 52 45 53 55 4C 54 2B 31 00 20 4C 44 41 20 |A RESULT+1. LDA |
00000840: 4B 49 4E 42 55 46 2C 58 00 20 41 4E 44 20 23 31 |KINBUF,X. AND #1|
00000850: 35 00 20 43 4C 43 00 20 41 44 43 20 52 45 53 55 |5. CLC. ADC RESU|
00000860: 4C 54 00 20 53 54 41 20 52 45 53 55 4C 54 00 20 |LT. STA RESULT. |
00000870: 4C 44 41 20 23 30 00 20 41 44 43 20 52 45 53 55 |LDA #0. ADC RESU|
00000880: 4C 54 2B 31 00 20 53 54 41 20 52 45 53 55 4C 54 |LT+1. STA RESULT|
00000890: 2B 31 00 20 49 4E 58 00 20 43 50 58 20 4B 65 79 |+1. INX. CPX Key|
000008A0: 69 6E 6C 65 6E 00 20 42 4E 45 20 44 45 43 4C 4F |inlen. BNE DECLO|
000008B0: 50 00 20 52 54 53 00 3B 2D 2D 2D 2D 2D 2D 2D 2D |P. RTS.;--------|
000008C0: 2D 2A 00 42 49 4E 44 45 43 00 6A 73 72 20 6D 6F |-*.BINDEC.jsr mo|
000008D0: 76 65 32 76 61 6C 75 65 00 20 4C 44 41 20 23 30 |ve2value. LDA #0|
000008E0: 00 3B 20 53 45 54 20 44 49 53 4C 45 4E 20 54 4F |.; SET DISLEN TO|
000008F0: 20 5A 45 52 4F 00 20 53 54 41 20 44 49 53 4C 45 | ZERO. STA DISLE|
00000900: 4E 00 43 4F 4E 56 52 54 00 20 4C 44 41 20 23 30 |N.CONVRT. LDA #0|
00000910: 00 20 53 54 41 20 4D 4F 44 31 30 00 20 53 54 41 |. STA MOD10. STA|
00000920: 20 4D 4F 44 31 30 2B 31 00 20 4C 44 58 20 23 31 | MOD10+1. LDX #1|
00000930: 36 00 20 43 4C 43 00 44 56 44 45 4C 50 00 20 52 |6. CLC.DVDELP. R|
00000940: 4F 4C 20 56 41 4C 55 45 00 20 52 4F 4C 20 56 41 |OL VALUE. ROL VA|
00000950: 4C 55 45 2B 31 00 20 52 4F 4C 20 4D 4F 44 31 30 |LUE+1. ROL MOD10|
00000960: 00 20 52 4F 4C 20 4D 4F 44 31 30 2B 31 00 20 53 |. ROL MOD10+1. S|
00000970: 45 43 00 20 4C 44 41 20 4D 4F 44 31 30 00 20 53 |EC. LDA MOD10. S|
00000980: 42 43 20 23 31 30 00 20 54 41 59 00 20 4C 44 41 |BC #10. TAY. LDA|
00000990: 20 4D 4F 44 31 30 2B 31 00 20 53 42 43 20 23 30 | MOD10+1. SBC #0|
000009A0: 00 20 42 43 43 20 43 4E 54 4D 4F 44 00 20 53 54 |. BCC CNTMOD. ST|
000009B0: 59 20 4D 4F 44 31 30 00 20 53 54 41 20 4D 4F 44 |Y MOD10. STA MOD|
000009C0: 31 30 2B 31 00 43 4E 54 4D 4F 44 00 20 44 45 58 |10+1.CNTMOD. DEX|
000009D0: 00 20 42 4E 45 20 44 56 44 45 4C 50 00 20 52 4F |. BNE DVDELP. RO|
000009E0: 4C 20 56 41 4C 55 45 00 20 52 4F 4C 20 56 41 4C |L VALUE. ROL VAL|
000009F0: 55 45 2B 31 00 20 4C 44 41 20 4D 4F 44 31 30 00 |UE+1. LDA MOD10.|
00000A00: 20 43 4C 43 00 20 41 44 43 20 23 34 38 00 20 54 | CLC. ADC #48. T|
00000A10: 41 58 00 20 4C 44 59 20 44 49 53 4C 45 4E 00 20 |AX. LDY DISLEN. |
00000A20: 42 45 51 20 4E 4F 53 54 52 45 00 49 4E 43 42 55 |BEQ NOSTRE.INCBU|
00000A30: 46 00 20 4C 44 41 20 44 58 53 42 55 46 2D 31 2C |F. LDA DXSBUF-1,|
00000A40: 59 00 20 53 54 41 20 44 58 53 42 55 46 2C 59 00 |Y. STA DXSBUF,Y.|
00000A50: 20 44 45 59 00 20 42 4E 45 20 49 4E 43 42 55 46 | DEY. BNE INCBUF|
00000A60: 00 4E 4F 53 54 52 45 00 20 54 58 41 00 20 53 54 |.NOSTRE. TXA. ST|
00000A70: 41 20 44 58 53 42 55 46 00 20 49 4E 43 20 44 49 |A DXSBUF. INC DI|
00000A80: 53 4C 45 4E 00 20 4C 44 41 20 56 41 4C 55 45 00 |SLEN. LDA VALUE.|
00000A90: 4F 52 41 20 56 41 4C 55 45 2B 31 00 20 42 4E 45 |ORA VALUE+1. BNE|
00000AA0: 20 43 4F 4E 56 52 54 00 20 52 54 53 00 3B 2D 2D | CONVRT. RTS.;--|
00000AB0: 2D 2D 2D 2D 2A 00 6D 6F 76 65 32 76 61 6C 75 65 |----*.move2value|
00000AC0: 00 20 6C 64 61 20 52 45 53 55 4C 54 00 20 53 54 |. lda RESULT. ST|
00000AD0: 41 20 56 41 4C 55 45 00 20 4C 44 41 20 52 45 53 |A VALUE. LDA RES|
00000AE0: 55 4C 54 2B 31 00 20 53 54 41 20 56 41 4C 55 45 |ULT+1. STA VALUE|
00000AF0: 2B 31 00 20 52 54 53 00 00 |+1. RTS.. |
; ASCII.; VALUE IS THE BINARY NUMBER CON
VERTED INTO ASCII CODE..VALUE .BYTE 0,0.
;MOD 10 IS A TEMPORARY WORK AREA.MOD10 .
BYTE 0,0.KEYINLEN .BYTE 0.KINBUF .BLOCK
32,0.DISLEN .BYTE 0.DXSBUF .BLOCK 32,0.;
CONVERSION ROUTINES.; USED TO CONVERT A
SCII CHARACTERS.; TO A WORD VALUE..; BEF
ORE ENTRY MOVE NUMBER TO.; CONVERT INTO
'VALUE' LOCATION.; RESULT IS STORED IN D
XSBUF.; AND LENGTH IS PLACED IN DISLEN.
; CONVERTS BINARY, DECIMAL AND HEXADECI
MAL.RESULT .BYTE 0,0.;=======.BIN2ST. JS
R MOVE2VALUE. LDA #0. TAY. TAX. STA DISL
EN. STA XLOOP.BINLP1. INC XLOOP. CLC. AS
L VALUE. ROL VALUE+1. BCS ONEBIN. TYA. B
NE DOTZER. TXA. BNE DOTZER. LDA XLOOP. C
MP #16. BNE BINLP1.DOTZER. LDA #48. STA
DXSBUF,X. BNE ENDLOP.ONEBIN LDA #49. ST
A DXSBUF,X.ENDLOP. INX. LDA XLOOP. CMP #
16. BNE BINLP1. STX DISLEN. RTS.XLOOP .B
YTE 0.;----------*.;BSTRING2BIN CONVERSI
ON ROUTINE.ST2BIN. LDA #0. STA RESULT. S
TA RESULT+1. TAX.BINLOP. ASL RESULT. ROL
RESULT+1. CLC. LDA KINBUF,X. AND #1. AD
C RESULT. STA RESULT. LDA #0. ADC RESULT
+1. STA RESULT+1. INX. CPX KEYINLEN. BNE
BINLOP. RTS.;-------*.;HEX2BIN CONVERSI
ON ROUTINE.HEXBIN. LDA #0. STA RESULT. S
TA RESULT+1. TAX.HEXLOP. CLC. ASL RESULT
. ROL RESULT+1. ASL RESULT. ROL RESULT+1
. ASL RESULT. ROL RESULT+1. ASL RESULT.
ROL RESULT+1. LDA KINBUF,X. CMP #65. BCC
MORHEX. SEC. SBC #7.MORHEX. AND #15. CL
C. ADC RESULT. STA RESULT. LDA #0. ADC R
ESULT+1. STA RESULT+1. INX. CPX KEYINLEN
. BNE HEXLOP. RTS.;--------*.BINHEX.JSR
MOVE2VALUE. LDA #0. STA DISLEN. TAX. LDA
VALUE+1. BEQ LOWBYT. LSR. LSR. LSR. LSR
. TAY. BEQ THEHEX. LDA HEXTBL,Y. STA DXS
BUF,X. INX.THEHEX LDA VALUE+1. AND #15.
TAY. LDA HEXTBL,Y. STA DXSBUF,X. INX.LO
WBYT. LDA VALUE. LSR. LSR. LSR. LSR. TAY
. BNE CONT22. TXA. BEQ ONEHEX.CONT22. LD
A HEXTBL,Y. STA DXSBUF,X. INX.ONEHEX. LD
A VALUE. AND #15. TAY. LDA HEXTBL,Y. STA
DXSBUF,X. INX. STX DISLEN. RTS.HEXTBL .
BYTE '0123456789ABCDEF'.;---------*.DECB
IN.STRDEC. LDA #0. STA RESULT. STA RESUL
T+1. TAX.DECLOP. CLC. ASL RESULT. ROL RE
SULT+1. LDA RESULT. LDY RESULT+1. ASL RE
SULT. ROL RESULT+1. ASL RESULT. ROL RESU
LT+1. CLC. ADC RESULT. STA RESULT. TYA.
ADC RESULT+1. STA RESULT+1. LDA KINBUF,X
. AND #15. CLC. ADC RESULT. STA RESULT.
LDA #0. ADC RESULT+1. STA RESULT+1. INX.
CPX KEYINLEN. BNE DECLOP. RTS.;--------
-*.BINDEC.JSR MOVE2VALUE. LDA #0.; SET D
ISLEN TO ZERO. STA DISLEN.CONVRT. LDA #0
. STA MOD10. STA MOD10+1. LDX #16. CLC.D
VDELP. ROL VALUE. ROL VALUE+1. ROL MOD10
. ROL MOD10+1. SEC. LDA MOD10. SBC #10.
TAY. LDA MOD10+1. SBC #0. BCC CNTMOD. ST
Y MOD10. STA MOD10+1.CNTMOD. DEX. BNE DV
DELP. ROL VALUE. ROL VALUE+1. LDA MOD10.
CLC. ADC #48. TAX. LDY DISLEN. BEQ NOST
RE.INCBUF. LDA DXSBUF-1,Y. STA DXSBUF,Y.
DEY. BNE INCBUF.NOSTRE. TXA. STA DXSBUF
. INC DISLEN. LDA VALUE.ORA VALUE+1. BNE
CONVRT. RTS.;------*.MOVE2VALUE. LDA RE
SULT. STA VALUE. LDA RESULT+1. STA VALUE
+1. RTS..
×
C64 Image
> CLICK IMAGE PREVIEW FOR FULL MODAL