_  __   _  _         _ _     _      _           _           
  __| |/ /_ | || |     __| (_)___| | __ (_)_ __   __| | _____  __
 / _` | '_ \| || |_   / _` | / __| |/ / | | '_ \ / _` |/ _ \ \/ /
| (_| | (_) |__   _| | (_| | \__ \   <  | | | | | (_| |  __/>  < 
 \__,_|\___/   |_|    \__,_|_|___/_|\_\ |_|_| |_|\__,_|\___/_/\_\
                                                                 
            

MATH

FILE INFORMATION

FILENAME(S): MATH

FILE TYPE(S): USR

FILE SIZE: 3.5K

FIRST SEEN: 2025-10-20 14:30:03

APPEARS ON: 3 disk(s)

FILE HASH

7535dde76bc55c26f9ff3c4c33be2ce356103f8d7fb05e8524ed9ec56445db03

FOUND ON DISKS (3 DISKS)

DISK TITLE FILENAME FILE TYPE COLLECTION TRACK SECTOR ACTIONS
S 1286 MATH USR Treasure Chest - Klaus Der Suhler 17 2 DOWNLOAD FILE
G PD 85 MATH USR Treasure Chest - Klaus Der Suhler 17 10 DOWNLOAD FILE
S 1286 MATH USR Treasure Chest - Klaus Der Suhler 17 10 DOWNLOAD FILE

FILE CONTENT & ANALYSIS

00000000: 3B 4D 41 54 48 2E 41 53  53 4D 00 3B 4D 41 54 48  |;MATH.ASSM.;MATH|
00000010: 20 52 4F 55 54 49 4E 45  53 20 46 4F 52 20 54 48  | ROUTINES FOR TH|
00000020: 45 20 41 53 53 45 4D 42  4C 45 52 00 3B 20 47 45  |E ASSEMBLER.; GE|
00000030: 4E 45 52 41 4C 20 4C 49  42 52 41 52 59 20 46 49  |NERAL LIBRARY FI|
00000040: 4C 45 00 3B 2A 2A 2A 2A  2A 2A 2A 00 43 55 52 4E  |LE.;*******.CURN|
00000050: 55 4D 20 2E 42 59 54 45  20 30 2C 30 00 50 52 45  |UM .BYTE 0,0.PRE|
00000060: 4E 55 4D 20 2E 42 59 54  45 20 30 2C 30 00 57 4F  |NUM .BYTE 0,0.WO|
00000070: 52 44 31 20 2E 42 59 54  45 20 30 2C 30 00 57 4F  |RD1 .BYTE 0,0.WO|
00000080: 52 44 32 20 2E 42 59 54  45 20 30 2C 30 00 43 55  |RD2 .BYTE 0,0.CU|
00000090: 52 46 55 4E 20 2E 42 59  54 45 20 30 00 50 52 45  |RFUN .BYTE 0.PRE|
000000A0: 46 55 4E 20 2E 42 59 54  45 20 30 00 53 54 41 43  |FUN .BYTE 0.STAC|
000000B0: 4B 20 2E 42 6C 6F 63 6B  20 32 34 2C 30 00 53 54  |K .Block 24,0.ST|
000000C0: 4B 50 54 52 20 2E 42 59  54 45 20 30 00 43 41 52  |KPTR .BYTE 0.CAR|
000000D0: 52 59 20 2E 42 59 54 45  20 33 32 00 43 55 52 50  |RY .BYTE 32.CURP|
000000E0: 52 49 20 2E 42 59 54 45  20 30 00 50 52 45 50 52  |RI .BYTE 0.PREPR|
000000F0: 49 20 2E 42 59 54 45 20  30 00 50 52 49 46 55 4E  |I .BYTE 0.PRIFUN|
00000100: 20 2E 42 59 54 45 20 34  33 2C 34 35 2C 34 32 2C  | .BYTE 43,45,42,|
00000110: 34 37 2C 36 31 2C 31 32  34 2C 33 38 2C 39 34 00  |47,61,124,38,94.|
00000120: 50 52 49 4C 45 56 20 2E  42 59 54 45 20 34 2C 34  |PRILEV .BYTE 4,4|
00000130: 2C 35 2C 35 2C 30 2C 31  2C 33 2C 32 00 4A 4D 50  |,5,5,0,1,3,2.JMP|
00000140: 53 54 4B 20 4A 4D 50 20  50 53 48 53 54 4B 00 4A  |STK JMP PSHSTK.J|
00000150: 4D 50 54 4F 4C 20 4A 4D  50 20 54 4F 54 41 4C 00  |MPTOL JMP TOTAL.|
00000160: 3B 2A 2A 2A 2A 2A 2A 2A  2A 00 4D 41 54 48 00 20  |;********.MATH. |
00000170: 53 54 41 20 43 55 52 46  55 4E 00 20 4A 53 52 20  |STA CURFUN. JSR |
00000180: 46 4E 44 50 52 49 00 20  53 54 59 20 43 55 52 50  |FNDPRI. STY CURP|
00000190: 52 49 00 20 4C 44 41 20  52 45 53 55 4C 54 00 20  |RI. LDA RESULT. |
000001A0: 53 54 41 20 43 55 52 4E  55 4D 00 20 4C 44 41 20  |STA CURNUM. LDA |
000001B0: 52 45 53 55 4C 54 2B 31  00 20 53 54 41 20 43 55  |RESULT+1. STA CU|
000001C0: 52 4E 55 4D 2B 31 00 3B  4C 44 41 20 23 33 32 00  |RNUM+1.;LDA #32.|
000001D0: 3B 53 54 41 20 43 41 52  52 59 00 20 4C 44 41 20  |;STA CARRY. LDA |
000001E0: 43 55 52 46 55 4E 00 20  43 4D 50 20 23 36 31 00  |CURFUN. CMP #61.|
000001F0: 20 42 45 51 20 20 4A 4D  50 54 4F 4C 00 20 4C 44  | BEQ  JMPTOL. LD|
00000200: 41 20 4B 65 79 69 6E 6C  65 6E 00 20 42 4E 45 20  |A Keyinlen. BNE |
00000210: 4C 4F 50 53 54 4B 00 20  4C 44 58 20 53 54 4B 50  |LOPSTK. LDX STKP|
00000220: 54 52 00 20 42 45 51 20  4C 4F 50 53 54 4B 00 20  |TR. BEQ LOPSTK. |
00000230: 44 45 58 00 20 4C 44 41  20 43 55 52 46 55 4E 00  |DEX. LDA CURFUN.|
00000240: 20 53 54 41 20 53 54 41  43 4B 2C 58 00 20 52 54  | STA STACK,X. RT|
00000250: 53 00 3B 2D 2D 2D 2D 2A  00 4C 55 50 53 54 4B 20  |S.;----*.LUPSTK |
00000260: 20 4C 44 41 20 57 4F 52  44 31 00 20 53 54 41 20  | LDA WORD1. STA |
00000270: 43 55 52 4E 55 4D 00 20  53 54 41 20 52 45 53 55  |CURNUM. STA RESU|
00000280: 4C 54 00 20 4C 44 41 20  57 4F 52 44 31 2B 31 00  |LT. LDA WORD1+1.|
00000290: 20 53 54 41 20 43 55 52  4E 55 4D 2B 31 00 20 53  | STA CURNUM+1. S|
000002A0: 54 41 20 52 45 53 55 4C  54 2B 31 00 3B 00 4C 4F  |TA RESULT+1.;.LO|
000002B0: 50 53 54 4B 00 20 4C 44  58 20 53 54 4B 50 54 52  |PSTK. LDX STKPTR|
000002C0: 00 20 42 45 51 20 20 4A  4D 50 53 54 4B 00 20 44  |. BEQ  JMPSTK. D|
000002D0: 45 58 00 20 4C 44 41 20  53 54 41 43 4B 2C 58 00  |EX. LDA STACK,X.|
000002E0: 20 53 54 41 20 50 52 45  46 55 4E 00 20 4A 53 52  | STA PREFUN. JSR|
000002F0: 20 46 4E 44 50 52 49 00  20 53 54 59 20 50 52 45  | FNDPRI. STY PRE|
00000300: 50 52 49 00 20 44 45 58  00 20 4C 44 41 20 53 54  |PRI. DEX. LDA ST|
00000310: 41 43 4B 2C 58 00 20 53  54 41 20 50 52 45 4E 55  |ACK,X. STA PRENU|
00000320: 4D 2B 31 00 20 44 45 58  00 20 4C 44 41 20 53 54  |M+1. DEX. LDA ST|
00000330: 41 43 4B 2C 58 00 20 53  54 41 20 50 52 45 4E 55  |ACK,X. STA PRENU|
00000340: 4D 00 20 53 54 58 20 53  54 4B 50 54 52 00 20 4C  |M. STX STKPTR. L|
00000350: 44 41 20 50 52 45 50 52  49 00 20 43 4D 50 20 43  |DA PREPRI. CMP C|
00000360: 55 52 50 52 49 00 20 42  43 43 20 4A 4D 50 4E 4F  |URPRI. BCC JMPNO|
00000370: 54 00 20 4C 44 41 20 50  52 45 4E 55 4D 00 20 53  |T. LDA PRENUM. S|
00000380: 54 41 20 57 4F 52 44 31  00 20 4C 44 41 20 50 52  |TA WORD1. LDA PR|
00000390: 45 4E 55 4D 2B 31 00 20  53 54 41 20 57 4F 52 44  |ENUM+1. STA WORD|
000003A0: 31 2B 31 00 20 4C 44 41  20 43 55 52 4E 55 4D 00  |1+1. LDA CURNUM.|
000003B0: 20 53 54 41 20 57 4F 52  44 32 00 20 4C 44 41 20  | STA WORD2. LDA |
000003C0: 43 55 52 4E 55 4D 2B 31  00 20 53 54 41 20 57 4F  |CURNUM+1. STA WO|
000003D0: 52 44 32 2B 31 00 20 4C  44 41 20 50 52 45 46 55  |RD2+1. LDA PREFU|
000003E0: 4E 00 20 43 4D 50 20 23  34 33 00 20 42 45 51 20  |N. CMP #43. BEQ |
000003F0: 4A 4D 50 50 4C 53 00 20  43 4D 50 20 23 34 35 00  |JMPPLS. CMP #45.|
00000400: 20 42 45 51 20 4A 4D 50  4D 49 4E 00 20 43 4D 50  | BEQ JMPMIN. CMP|
00000410: 20 23 34 32 00 20 42 45  51 20 4A 4D 50 4D 55 4C  | #42. BEQ JMPMUL|
00000420: 00 20 43 4D 50 20 23 34  37 00 20 42 45 51 20 4A  |. CMP #47. BEQ J|
00000430: 4D 50 44 49 56 00 20 43  4D 50 20 23 33 38 00 20  |MPDIV. CMP #38. |
00000440: 42 45 51 20 4A 4D 50 41  4E 44 00 20 43 4D 50 20  |BEQ JMPAND. CMP |
00000450: 23 39 34 00 20 42 45 51  20 4A 4D 50 45 4F 52 00  |#94. BEQ JMPEOR.|
00000460: 20 43 4D 50 20 23 31 32  34 00 20 42 45 51 20 4A  | CMP #124. BEQ J|
00000470: 4D 50 4F 52 41 00 20 52  54 53 00 3B 2D 2D 2D 2D  |MPORA. RTS.;----|
00000480: 2D 2D 2D 2A 00 4A 4D 50  50 4C 53 20 4A 4D 50 20  |---*.JMPPLS JMP |
00000490: 50 4C 55 53 00 4A 4D 50  4D 49 4E 20 4A 4D 50 20  |PLUS.JMPMIN JMP |
000004A0: 4D 49 4E 55 53 00 4A 4D  50 44 49 56 20 4A 4D 50  |MINUS.JMPDIV JMP|
000004B0: 20 44 49 56 49 44 45 00  4A 4D 50 4D 55 4C 20 4A  | DIVIDE.JMPMUL J|
000004C0: 4D 50 20 4D 55 4C 54 49  00 4A 4D 50 4E 4F 54 20  |MP MULTI.JMPNOT |
000004D0: 4A 4D 50 20 44 4F 54 48  49 4E 00 4A 4D 50 41 4E  |JMP DOTHIN.JMPAN|
000004E0: 44 20 4A 4D 50 20 41 4E  44 4E 55 4D 00 4A 4D 50  |D JMP ANDNUM.JMP|
000004F0: 45 4F 52 20 4A 4D 50 20  45 4F 52 4E 55 4D 00 4A  |EOR JMP EORNUM.J|
00000500: 4D 50 4F 52 41 20 4A 4D  50 20 4F 52 41 4E 55 4D  |MPORA JMP ORANUM|
00000510: 00 3B 2D 2D 2D 2D 2A 00  54 4F 54 41 4C 00 20 4C  |.;----*.TOTAL. L|
00000520: 44 41 20 4B 65 79 69 6E  6C 65 6E 00 20 42 4E 45  |DA Keyinlen. BNE|
00000530: 20 54 4C 4C 4F 4F 50 20  3B 49 46 20 41 20 4E 55  | TLLOOP ;IF A NU|
00000540: 4D 20 57 41 53 20 45 4E  54 45 52 45 44 00 3B 20  |M WAS ENTERED.; |
00000550: 54 48 45 4E 20 43 4F 4E  54 49 4E 55 45 20 41 53  |THEN CONTINUE AS|
00000560: 20 41 4C 57 41 59 53 00  20 4C 44 58 20 53 54 4B  | ALWAYS. LDX STK|
00000570: 50 54 52 00 20 42 45 51  20 54 4C 4C 4F 4F 50 00  |PTR. BEQ TLLOOP.|
00000580: 20 44 45 58 00 20 44 45  58 00 20 4C 44 41 20 53  | DEX. DEX. LDA S|
00000590: 54 41 43 4B 2C 58 3B 20  50 55 4C 4C 20 50 52 45  |TACK,X; PULL PRE|
000005A0: 56 49 4F 55 53 20 4E 55  4D 00 20 53 54 41 20 43  |VIOUS NUM. STA C|
000005B0: 55 52 4E 55 4D 2B 31 20  3B 20 20 41 4E 44 20 50  |URNUM+1 ;  AND P|
000005C0: 4C 41 43 45 20 49 54 20  41 53 20 49 46 00 3B 20  |LACE IT AS IF.; |
000005D0: 41 53 20 45 4E 54 45 52  45 44 20 57 49 54 48 20  |AS ENTERED WITH |
000005E0: 27 3D 27 00 20 44 45 58  00 20 4C 44 41 20 53 54  |'='. DEX. LDA ST|
000005F0: 41 43 4B 2C 58 00 20 53  54 41 20 43 55 52 4E 55  |ACK,X. STA CURNU|
00000600: 4D 00 20 53 54 58 20 53  54 4B 50 54 52 00 54 4C  |M. STX STKPTR.TL|
00000610: 4C 4F 4F 50 20 4A 53 52  20 4C 4F 50 53 54 4B 00  |LOOP JSR LOPSTK.|
00000620: 20 4C 44 58 20 53 54 4B  50 54 52 00 20 42 45 51  | LDX STKPTR. BEQ|
00000630: 20 45 58 54 54 54 4C 00  20 44 45 58 00 20 4C 44  | EXTTTL. DEX. LD|
00000640: 41 20 53 54 41 43 4B 2C  58 00 20 53 54 41 20 50  |A STACK,X. STA P|
00000650: 52 45 46 55 4E 00 20 4A  53 52 20 46 4E 44 50 52  |REFUN. JSR FNDPR|
00000660: 49 00 20 53 54 59 20 50  52 45 50 52 49 00 20 44  |I. STY PREPRI. D|
00000670: 45 58 00 20 4C 44 41 20  53 54 41 43 4B 2C 58 00  |EX. LDA STACK,X.|
00000680: 20 53 54 41 20 52 45 53  55 4C 54 2B 31 00 20 44  | STA RESULT+1. D|
00000690: 45 58 00 20 4C 44 41 20  53 54 41 43 4B 2C 58 00  |EX. LDA STACK,X.|
000006A0: 20 53 54 41 20 52 45 53  55 4C 54 00 20 53 54 58  | STA RESULT. STX|
000006B0: 20 53 54 4B 50 54 52 00  45 58 54 54 54 4C 00 20  | STKPTR.EXTTTL. |
000006C0: 52 54 53 00 3B 2D 2D 2D  2D 2D 2D 2D 2D 2A 00 44  |RTS.;--------*.D|
000006D0: 4F 54 48 49 4E 00 20 4C  44 41 20 53 54 4B 50 54  |OTHIN. LDA STKPT|
000006E0: 52 00 20 41 44 43 20 23  33 00 20 53 54 41 20 53  |R. ADC #3. STA S|
000006F0: 54 4B 50 54 52 00 20 4A  4D 50 20 50 53 48 53 54  |TKPTR. JMP PSHST|
00000700: 4B 00 3B 2D 2D 2D 2D 2D  2D 2D 2A 00 50 4C 55 53  |K.;-------*.PLUS|
00000710: 00 20 43 4C 43 00 20 4C  44 41 20 57 4F 52 44 31  |. CLC. LDA WORD1|
00000720: 00 20 41 44 43 20 57 4F  52 44 32 00 20 53 54 41  |. ADC WORD2. STA|
00000730: 20 57 4F 52 44 31 00 20  4C 44 41 20 57 4F 52 44  | WORD1. LDA WORD|
00000740: 31 2B 31 00 20 41 44 43  20 57 4F 52 44 32 2B 31  |1+1. ADC WORD2+1|
00000750: 00 20 53 54 41 20 57 4F  52 44 31 2B 31 00 20 42  |. STA WORD1+1. B|
00000760: 43 43 20 4E 4F 41 44 44  43 00 20 4C 44 41 20 23  |CC NOADDC. LDA #|
00000770: 36 37 00 20 53 54 41 20  43 41 52 52 59 00 4E 4F  |67. STA CARRY.NO|
00000780: 41 44 44 43 00 20 4A 4D  50 20 4C 55 50 53 54 4B  |ADDC. JMP LUPSTK|
00000790: 00 3B 2D 2D 2D 2D 2D 2D  2D 2D 2D 2D 2A 00 4D 49  |.;----------*.MI|
000007A0: 4E 55 53 00 20 53 45 43  00 20 4C 44 41 20 57 4F  |NUS. SEC. LDA WO|
000007B0: 52 44 31 00 20 53 42 43  20 57 4F 52 44 32 00 20  |RD1. SBC WORD2. |
000007C0: 53 54 41 20 57 4F 52 44  31 00 20 4C 44 41 20 57  |STA WORD1. LDA W|
000007D0: 4F 52 44 31 2B 31 00 20  53 42 43 20 57 4F 52 44  |ORD1+1. SBC WORD|
000007E0: 32 2B 31 00 20 53 54 41  20 57 4F 52 44 31 2B 31  |2+1. STA WORD1+1|
000007F0: 00 20 42 43 53 20 4E 4F  53 55 42 43 00 20 4C 44  |. BCS NOSUBC. LD|
00000800: 41 20 23 36 37 00 20 53  54 41 20 43 41 52 52 59  |A #67. STA CARRY|
00000810: 00 4E 4F 53 55 42 43 00  20 4A 4D 50 20 4C 55 50  |.NOSUBC. JMP LUP|
00000820: 53 54 4B 00 3B 2D 2D 2D  2D 2D 2D 2D 2D 2D 2A 00  |STK.;---------*.|
00000830: 41 4E 44 4E 55 4D 00 20  4C 44 41 20 57 4F 52 44  |ANDNUM. LDA WORD|
00000840: 31 00 20 41 4E 44 20 57  4F 52 44 32 00 20 53 54  |1. AND WORD2. ST|
00000850: 41 20 57 4F 52 44 31 00  20 4C 44 41 20 57 4F 52  |A WORD1. LDA WOR|
00000860: 44 31 2B 31 00 20 41 4E  44 20 57 4F 52 44 32 2B  |D1+1. AND WORD2+|
00000870: 31 00 20 53 54 41 20 57  4F 52 44 31 2B 31 00 20  |1. STA WORD1+1. |
00000880: 4A 4D 50 20 4C 55 50 53  54 4B 00 3B 2D 2D 2D 2D  |JMP LUPSTK.;----|
00000890: 2D 2D 2D 2D 2D 2A 00 4F  52 41 4E 55 4D 00 20 4C  |-----*.ORANUM. L|
000008A0: 44 41 20 57 4F 52 44 31  00 20 4F 52 41 20 57 4F  |DA WORD1. ORA WO|
000008B0: 52 44 32 00 20 53 54 41  20 57 4F 52 44 31 00 20  |RD2. STA WORD1. |
000008C0: 4C 44 41 20 57 4F 52 44  31 2B 31 00 20 4F 52 41  |LDA WORD1+1. ORA|
000008D0: 20 57 4F 52 44 32 2B 31  00 20 53 54 41 20 57 4F  | WORD2+1. STA WO|
000008E0: 52 44 31 2B 31 00 20 4A  4D 50 20 4C 55 50 53 54  |RD1+1. JMP LUPST|
000008F0: 4B 00 3B 2D 2D 2D 2D 2D  2D 2D 2D 2D 2A 00 45 4F  |K.;---------*.EO|
00000900: 52 4E 55 4D 00 20 4C 44  41 20 57 4F 52 44 31 00  |RNUM. LDA WORD1.|
00000910: 20 45 4F 52 20 57 4F 52  44 32 00 20 53 54 41 20  | EOR WORD2. STA |
00000920: 57 4F 52 44 31 00 20 4C  44 41 20 57 4F 52 44 31  |WORD1. LDA WORD1|
00000930: 2B 31 00 20 45 4F 52 20  57 4F 52 44 32 2B 31 00  |+1. EOR WORD2+1.|
00000940: 20 53 54 41 20 57 4F 52  44 31 2B 31 00 20 4A 4D  | STA WORD1+1. JM|
00000950: 50 20 4C 55 50 53 54 4B  00 3B 2D 2D 2D 2D 2D 2D  |P LUPSTK.;------|
00000960: 2D 2D 2D 2A 00 4D 55 4C  54 49 00 20 4C 44 41 20  |---*.MULTI. LDA |
00000970: 23 30 00 20 53 54 41 20  48 49 57 4F 52 44 00 20  |#0. STA HIWORD. |
00000980: 53 54 41 20 48 49 57 4F  52 44 2B 31 00 20 4C 44  |STA HIWORD+1. LD|
00000990: 58 20 23 31 36 00 20 43  4C 43 00 4D 4C 4C 4F 4F  |X #16. CLC.MLLOO|
000009A0: 50 20 52 4F 52 20 48 49  57 4F 52 44 2B 31 00 20  |P ROR HIWORD+1. |
000009B0: 52 4F 52 20 48 49 57 4F  52 44 00 20 52 4F 52 20  |ROR HIWORD. ROR |
000009C0: 57 4F 52 44 32 2B 31 00  20 52 4F 52 20 57 4F 52  |WORD2+1. ROR WOR|
000009D0: 44 32 00 20 42 43 43 20  4E 58 4D 55 4C 54 00 20  |D2. BCC NXMULT. |
000009E0: 43 4C 43 00 20 4C 44 41  20 57 4F 52 44 31 00 20  |CLC. LDA WORD1. |
000009F0: 41 44 43 20 48 49 57 4F  52 44 00 20 53 54 41 20  |ADC HIWORD. STA |
00000A00: 48 49 57 4F 52 44 00 20  4C 44 41 20 57 4F 52 44  |HIWORD. LDA WORD|
00000A10: 31 2B 31 00 20 41 44 43  20 48 49 57 4F 52 44 2B  |1+1. ADC HIWORD+|
00000A20: 31 00 20 53 54 41 20 48  49 57 4F 52 44 2B 31 00  |1. STA HIWORD+1.|
00000A30: 4E 58 4D 55 4C 54 20 44  45 58 00 20 42 50 4C 20  |NXMULT DEX. BPL |
00000A40: 4D 4C 4C 4F 4F 50 00 20  4C 44 41 20 48 49 57 4F  |MLLOOP. LDA HIWO|
00000A50: 52 44 00 20 4F 52 41 20  48 49 57 4F 52 44 2B 31  |RD. ORA HIWORD+1|
00000A60: 00 20 42 45 51 20 4D 55  4C 54 49 31 00 20 4C 44  |. BEQ MULTI1. LD|
00000A70: 41 20 23 36 37 00 20 53  54 41 20 43 41 52 52 59  |A #67. STA CARRY|
00000A80: 00 4D 55 4C 54 49 31 00  20 4C 44 41 20 57 4F 52  |.MULTI1. LDA WOR|
00000A90: 44 32 00 20 53 54 41 20  43 55 52 4E 55 4D 00 20  |D2. STA CURNUM. |
00000AA0: 53 54 41 20 52 45 53 55  4C 54 00 20 4C 44 41 20  |STA RESULT. LDA |
00000AB0: 57 4F 52 44 32 2B 31 00  20 53 54 41 20 43 55 52  |WORD2+1. STA CUR|
00000AC0: 4E 55 4D 2B 31 00 20 53  54 41 20 52 45 53 55 4C  |NUM+1. STA RESUL|
00000AD0: 54 2B 31 00 20 4A 4D 50  20 4C 4F 50 53 54 4B 00  |T+1. JMP LOPSTK.|
00000AE0: 48 49 57 4F 52 44 20 2E  42 59 54 45 20 30 2C 30  |HIWORD .BYTE 0,0|
00000AF0: 00 3B 2D 2D 2D 2D 2D 2D  2D 2D 2D 2A 00 44 49 56  |.;---------*.DIV|
00000B00: 49 44 45 00 20 4C 44 41  20 23 30 00 20 53 54 41  |IDE. LDA #0. STA|
00000B10: 20 48 49 57 4F 52 44 00  20 53 54 41 20 48 49 57  | HIWORD. STA HIW|
00000B20: 4F 52 44 2B 31 00 20 4C  44 41 20 57 4F 52 44 32  |ORD+1. LDA WORD2|
00000B30: 00 20 4F 52 41 20 57 4F  52 44 32 2B 31 00 20 42  |. ORA WORD2+1. B|
00000B40: 4E 45 20 44 49 56 4F 4B  00 20 53 45 43 00 20 42  |NE DIVOK. SEC. B|
00000B50: 43 53 20 44 56 44 45 52  52 00 44 49 56 4F 4B 00  |CS DVDERR.DIVOK.|
00000B60: 20 4C 44 58 20 23 31 36  00 44 56 4C 4F 4F 50 00  | LDX #16.DVLOOP.|
00000B70: 20 52 4F 4C 20 57 4F 52  44 31 00 20 52 4F 4C 20  | ROL WORD1. ROL |
00000B80: 57 4F 52 44 31 2B 31 00  20 52 4F 4C 20 48 49 57  |WORD1+1. ROL HIW|
00000B90: 4F 52 44 00 20 52 4F 4C  20 48 49 57 4F 52 44 2B  |ORD. ROL HIWORD+|
00000BA0: 31 00 20 53 45 43 00 20  4C 44 41 20 48 49 57 4F  |1. SEC. LDA HIWO|
00000BB0: 52 44 00 20 53 42 43 20  57 4F 52 44 32 00 20 54  |RD. SBC WORD2. T|
00000BC0: 41 59 00 20 4C 44 41 20  48 49 57 4F 52 44 2B 31  |AY. LDA HIWORD+1|
00000BD0: 00 20 53 42 43 20 57 4F  52 44 32 2B 31 00 20 42  |. SBC WORD2+1. B|
00000BE0: 43 43 20 44 49 56 4C 50  32 00 20 53 54 59 20 48  |CC DIVLP2. STY H|
00000BF0: 49 57 4F 52 44 00 20 53  54 41 20 48 49 57 4F 52  |IWORD. STA HIWOR|
00000C00: 44 2B 31 00 44 49 56 4C  50 32 00 20 44 45 58 00  |D+1.DIVLP2. DEX.|
00000C10: 20 42 4E 45 20 44 56 4C  4F 4F 50 00 20 52 4F 4C  | BNE DVLOOP. ROL|
00000C20: 20 57 4F 52 44 31 00 20  52 4F 4C 20 57 4F 52 44  | WORD1. ROL WORD|
00000C30: 31 2B 31 00 20 43 4C 43  00 20 4C 44 41 20 48 49  |1+1. CLC. LDA HI|
00000C40: 57 4F 52 44 00 20 4F 52  41 20 48 49 57 4F 52 44  |WORD. ORA HIWORD|
00000C50: 2B 31 00 20 42 45 51 20  44 56 49 44 45 31 00 20  |+1. BEQ DVIDE1. |
00000C60: 4C 44 41 20 23 36 37 00  20 53 54 41 20 43 41 52  |LDA #67. STA CAR|
00000C70: 52 59 00 44 56 49 44 45  31 00 20 4A 4D 50 20 4C  |RY.DVIDE1. JMP L|
00000C80: 55 50 53 54 4B 00 44 56  44 45 52 52 20 20 52 54  |UPSTK.DVDERR  RT|
00000C90: 53 00 3B 2D 2D 2D 2D 2D  2D 2D 2D 2D 2D 2A 00 50  |S.;----------*.P|
00000CA0: 53 48 53 54 4B 00 20 4C  44 58 20 53 54 4B 50 54  |SHSTK. LDX STKPT|
00000CB0: 52 00 20 4C 44 41 20 43  55 52 4E 55 4D 00 20 53  |R. LDA CURNUM. S|
00000CC0: 54 41 20 53 54 41 43 4B  2C 58 00 20 49 4E 58 00  |TA STACK,X. INX.|
00000CD0: 20 4C 44 41 20 43 55 52  4E 55 4D 2B 31 00 20 53  | LDA CURNUM+1. S|
00000CE0: 54 41 20 53 54 41 43 4B  2C 58 00 20 49 4E 58 00  |TA STACK,X. INX.|
00000CF0: 20 4C 44 41 20 43 55 52  46 55 4E 00 20 53 54 41  | LDA CURFUN. STA|
00000D00: 20 53 54 41 43 4B 2C 58  00 20 49 4E 58 00 20 53  | STACK,X. INX. S|
00000D10: 54 58 20 53 54 4B 50 54  52 00 20 52 54 53 00 3B  |TX STKPTR. RTS.;|
00000D20: 2D 2D 2D 2D 2D 2D 2D 2D  2A 00 46 4E 44 50 52 49  |--------*.FNDPRI|
00000D30: 00 3B 20 4F 4E 20 45 4E  54 52 59 20 41 20 48 4F  |.; ON ENTRY A HO|
00000D40: 4C 44 53 20 56 41 4C 55  45 20 54 4F 20 4C 4F 4F  |LDS VALUE TO LOO|
00000D50: 4B 20 55 50 00 3B 20 4F  4E 20 45 58 49 54 20 59  |K UP.; ON EXIT Y|
00000D60: 20 48 4F 4C 44 53 20 54  48 45 20 50 52 49 4F 52  | HOLDS THE PRIOR|
00000D70: 49 54 59 20 4C 45 56 45  4C 2E 00 3B 20 41 26 58  |ITY LEVEL..; A&X|
00000D80: 20 43 41 4E 4E 4F 54 20  42 45 20 43 48 41 4E 47  | CANNOT BE CHANG|
00000D90: 45 44 2E 00 20 53 54 41  20 46 4E 44 41 56 4C 00  |ED.. STA FNDAVL.|
00000DA0: 20 53 54 58 20 46 4E 44  58 56 4C 00 20 4C 44 58  | STX FNDXVL. LDX|
00000DB0: 20 23 32 35 35 00 50 52  4C 4F 4F 50 20 49 4E 58  | #255.PRLOOP INX|
00000DC0: 00 20 43 4D 50 20 50 52  49 46 55 4E 2C 58 00 20  |. CMP PRIFUN,X. |
00000DD0: 42 4E 45 20 50 52 4C 4F  4F 50 00 20 4C 44 59 20  |BNE PRLOOP. LDY |
00000DE0: 50 52 49 4C 45 56 2C 58  00 20 4C 44 41 20 46 4E  |PRILEV,X. LDA FN|
00000DF0: 44 41 56 4C 00 20 4C 44  58 20 46 4E 44 58 56 4C  |DAVL. LDX FNDXVL|
00000E00: 00 20 52 54 53 00 46 4E  44 41 56 4C 20 2E 42 59  |. RTS.FNDAVL .BY|
00000E10: 54 45 20 30 00 46 4E 44  58 56 4C 20 2E 42 59 54  |TE 0.FNDXVL .BYT|
00000E20: 45 20 30 00 3B 45 4E 44  00 00                    |E 0.;END..      |
;MATH.ASSM.;MATH ROUTINES FOR THE ASSEMB
LER.; GENERAL LIBRARY FILE.;*******.CURN
UM .BYTE 0,0.PRENUM .BYTE 0,0.WORD1 .BYT
E 0,0.WORD2 .BYTE 0,0.CURFUN .BYTE 0.PRE
FUN .BYTE 0.STACK .BLOCK 24,0.STKPTR .BY
TE 0.CARRY .BYTE 32.CURPRI .BYTE 0.PREPR
I .BYTE 0.PRIFUN .BYTE 43,45,42,47,61,12
4,38,94.PRILEV .BYTE 4,4,5,5,0,1,3,2.JMP
STK JMP PSHSTK.JMPTOL JMP TOTAL.;*******
*.MATH. STA CURFUN. JSR FNDPRI. STY CURP
RI. LDA RESULT. STA CURNUM. LDA RESULT+1
. STA CURNUM+1.;LDA #32.;STA CARRY. LDA 
CURFUN. CMP #61. BEQ  JMPTOL. LDA KEYINL
EN. BNE LOPSTK. LDX STKPTR. BEQ LOPSTK. 
DEX. LDA CURFUN. STA STACK,X. RTS.;----*
.LUPSTK  LDA WORD1. STA CURNUM. STA RESU
LT. LDA WORD1+1. STA CURNUM+1. STA RESUL
T+1.;.LOPSTK. LDX STKPTR. BEQ  JMPSTK. D
EX. LDA STACK,X. STA PREFUN. JSR FNDPRI.
 STY PREPRI. DEX. LDA STACK,X. STA PRENU
M+1. DEX. LDA STACK,X. STA PRENUM. STX S
TKPTR. LDA PREPRI. CMP CURPRI. BCC JMPNO
T. LDA PRENUM. STA WORD1. LDA PRENUM+1. 
STA WORD1+1. LDA CURNUM. STA WORD2. LDA 
CURNUM+1. STA WORD2+1. LDA PREFUN. CMP #
43. BEQ JMPPLS. CMP #45. BEQ JMPMIN. CMP
 #42. BEQ JMPMUL. CMP #47. BEQ JMPDIV. C
MP #38. BEQ JMPAND. CMP #94. BEQ JMPEOR.
 CMP #124. BEQ JMPORA. RTS.;-------*.JMP
PLS JMP PLUS.JMPMIN JMP MINUS.JMPDIV JMP
 DIVIDE.JMPMUL JMP MULTI.JMPNOT JMP DOTH
IN.JMPAND JMP ANDNUM.JMPEOR JMP EORNUM.J
MPORA JMP ORANUM.;----*.TOTAL. LDA KEYIN
LEN. BNE TLLOOP ;IF A NUM WAS ENTERED.; 
THEN CONTINUE AS ALWAYS. LDX STKPTR. BEQ
 TLLOOP. DEX. DEX. LDA STACK,X; PULL PRE
VIOUS NUM. STA CURNUM+1 ;  AND PLACE IT 
AS IF.; AS ENTERED WITH '='. DEX. LDA ST
ACK,X. STA CURNUM. STX STKPTR.TLLOOP JSR
 LOPSTK. LDX STKPTR. BEQ EXTTTL. DEX. LD
A STACK,X. STA PREFUN. JSR FNDPRI. STY P
REPRI. DEX. LDA STACK,X. STA RESULT+1. D
EX. LDA STACK,X. STA RESULT. STX STKPTR.
EXTTTL. RTS.;--------*.DOTHIN. LDA STKPT
R. ADC #3. STA STKPTR. JMP PSHSTK.;-----
--*.PLUS. CLC. LDA WORD1. ADC WORD2. STA
 WORD1. LDA WORD1+1. ADC WORD2+1. STA WO
RD1+1. BCC NOADDC. LDA #67. STA CARRY.NO
ADDC. JMP LUPSTK.;----------*.MINUS. SEC
. LDA WORD1. SBC WORD2. STA WORD1. LDA W
ORD1+1. SBC WORD2+1. STA WORD1+1. BCS NO
SUBC. LDA #67. STA CARRY.NOSUBC. JMP LUP
STK.;---------*.ANDNUM. LDA WORD1. AND W
ORD2. STA WORD1. LDA WORD1+1. AND WORD2+
1. STA WORD1+1. JMP LUPSTK.;---------*.O
RANUM. LDA WORD1. ORA WORD2. STA WORD1. 
LDA WORD1+1. ORA WORD2+1. STA WORD1+1. J
MP LUPSTK.;---------*.EORNUM. LDA WORD1.
 EOR WORD2. STA WORD1. LDA WORD1+1. EOR 
WORD2+1. STA WORD1+1. JMP LUPSTK.;------
---*.MULTI. LDA #0. STA HIWORD. STA HIWO
RD+1. LDX #16. CLC.MLLOOP ROR HIWORD+1. 
ROR HIWORD. ROR WORD2+1. ROR WORD2. BCC 
NXMULT. CLC. LDA WORD1. ADC HIWORD. STA 
HIWORD. LDA WORD1+1. ADC HIWORD+1. STA H
IWORD+1.NXMULT DEX. BPL MLLOOP. LDA HIWO
RD. ORA HIWORD+1. BEQ MULTI1. LDA #67. S
TA CARRY.MULTI1. LDA WORD2. STA CURNUM. 
STA RESULT. LDA WORD2+1. STA CURNUM+1. S
TA RESULT+1. JMP LOPSTK.HIWORD .BYTE 0,0
.;---------*.DIVIDE. LDA #0. STA HIWORD.
 STA HIWORD+1. LDA WORD2. ORA WORD2+1. B
NE DIVOK. SEC. BCS DVDERR.DIVOK. LDX #16
.DVLOOP. ROL WORD1. ROL WORD1+1. ROL HIW
ORD. ROL HIWORD+1. SEC. LDA HIWORD. SBC 
WORD2. TAY. LDA HIWORD+1. SBC WORD2+1. B
CC DIVLP2. STY HIWORD. STA HIWORD+1.DIVL
P2. DEX. BNE DVLOOP. ROL WORD1. ROL WORD
1+1. CLC. LDA HIWORD. ORA HIWORD+1. BEQ 
DVIDE1. LDA #67. STA CARRY.DVIDE1. JMP L
UPSTK.DVDERR  RTS.;----------*.PSHSTK. L
DX STKPTR. LDA CURNUM. STA STACK,X. INX.
 LDA CURNUM+1. STA STACK,X. INX. LDA CUR
FUN. STA STACK,X. INX. STX STKPTR. RTS.;
--------*.FNDPRI.; ON ENTRY A HOLDS VALU
E TO LOOK UP.; ON EXIT Y HOLDS THE PRIOR
ITY LEVEL..; A&X CANNOT BE CHANGED.. STA
 FNDAVL. STX FNDXVL. LDX #255.PRLOOP INX
. CMP PRIFUN,X. BNE PRLOOP. LDY PRILEV,X
. LDA FNDAVL. LDX FNDXVL. RTS.FNDAVL .BY
TE 0.FNDXVL .BYTE 0.;END..
C64 Preview

> CLICK IMAGE PREVIEW FOR FULL MODAL