mirror of
https://github.com/Michaelangel007/apple2_russian_peasant_multiplication.git
synced 2024-10-04 17:57:57 +00:00
305 lines
11 KiB
ArmAsm
305 lines
11 KiB
ArmAsm
0000 **--------------------------------------------------------------
|
|
0000 002000: A9 07 LDA #$07
|
|
0002 002002: 20 2F FB JSR INIT
|
|
0005 002005: 20 58 FC JSR HOME
|
|
0008 002008: 20 94 20 JSR L002094
|
|
000B 00200B: 20 B4 20 JSR L0020B4
|
|
000E 00200E: 20 33 20 JSR L002033
|
|
0011 002011: 20 3B 20 JSR L00203B
|
|
0014 002014: 20 AC 20 JSR L0020AC
|
|
0017 _L002017
|
|
0017 002017: 20 1D 21 JSR L00211D
|
|
001A 00201A: B0 11 BCS L00202D ; {+11}
|
|
001C 00201C: 20 12 21 JSR L002112
|
|
001F 00201F: 90 03 BCC L002024 ; {+03}
|
|
0021 002021: 20 FC 20 JSR L0020FC
|
|
0024 _L002024
|
|
0024 002024: 20 2B 21 JSR L00212B
|
|
0027 002027: 20 42 21 JSR L002142
|
|
002A 00202A: 18 CLC
|
|
002B 00202B: 90 EA BCC L002017 ; {-16}
|
|
002D _L00202D
|
|
002D 00202D: 20 D1 20 JSR L0020D1
|
|
0030 002030: 4C 00 00 JMP $0000
|
|
0033 002033:
|
|
0033 **--------------------------------------------------------------
|
|
0033 _L002033
|
|
0033 002033: 20 A4 20 JSR L0020A4
|
|
0036 002036: 20 85 20 JSR L002085
|
|
0039 002039: D0 06 BNE L002041 ; {+06}
|
|
003B _L00203B
|
|
003B 00203B: 20 A8 20 JSR L0020A8
|
|
003E 00203E: 20 8A 20 JSR L00208A
|
|
0041 _L002041
|
|
0041 002041: 86 FA STX $FA
|
|
0043 002043: 84 FB STY $FB
|
|
0045 002045: A2 00 LDX #False
|
|
0047 _L002047
|
|
0047 002047: 20 6C 20 JSR L00206C
|
|
004A 00204A: B0 0D BCS L002059 ; {+0D}
|
|
004C 00204C: 20 ED FD JSR COUT
|
|
004F 00204F: 29 0F AND #$0F
|
|
0051 002051: 9D 00 25 STA $2500,x
|
|
0054 002054: E8 INX
|
|
0055 002055: 10 F0 BPL L002047 ; {-10}
|
|
0057 002057: 30 57 BMI L0020B0 ; {+57}
|
|
0059 _L002059
|
|
0059 002059: A0 00 LDY #False
|
|
005B 00205B: E0 00 CPX #False
|
|
005D 00205D: F0 0B BEQ L00206A ; {+0B}
|
|
005F _L00205F
|
|
005F 00205F: CA DEX
|
|
0060 002060: BD 00 25 LDA $2500,x
|
|
0063 002063: 91 FA STA ($FA),y
|
|
0065 002065: C8 INY
|
|
0066 002066: E0 00 CPX #False
|
|
0068 002068: D0 F5 BNE L00205F ; {-0B}
|
|
006A _L00206A
|
|
006A 00206A: F0 56 BEQ L0020C2 ; {+56}
|
|
006C _L00206C
|
|
006C 00206C: 20 0C FD JSR RDKEY
|
|
006F 00206F: C9 8D CMP #$8D
|
|
0071 002071: F0 0D BEQ L002080 ; {+0D}
|
|
0073 002073: C9 9B CMP #$9B
|
|
0075 002075: F0 0B BEQ L002082 ; {+0B}
|
|
0077 002077: C9 B0 CMP #$B0
|
|
0079 002079: 90 F1 BCC L00206C ; {-0F}
|
|
007B 00207B: C9 BA CMP #$BA
|
|
007D 00207D: B0 ED BCS L00206C ; {-13}
|
|
007F 00207F: 60 RTS
|
|
0080 002080:
|
|
0080 **--------------------------------------------------------------
|
|
0080 _L002080
|
|
0080 002080: 38 SEC
|
|
0081 002081: 60 RTS
|
|
0082 002082:
|
|
0082 **--------------------------------------------------------------
|
|
0082 _L002082
|
|
0082 002082: 68 PLA
|
|
0083 002083: 68 PLA
|
|
0084 002084: 60 RTS
|
|
0085 002085:
|
|
0085 **--------------------------------------------------------------
|
|
0085 _L002085
|
|
0085 002085: A2 00 LDX #False
|
|
0087 002087: A0 22 LDY #$22
|
|
0089 002089: 60 RTS
|
|
008A 00208A:
|
|
008A **--------------------------------------------------------------
|
|
008A _L00208A
|
|
008A 00208A: A2 00 LDX #False
|
|
008C 00208C: A0 23 LDY #$23
|
|
008E 00208E: 60 RTS
|
|
008F 00208F:
|
|
008F **--------------------------------------------------------------
|
|
008F _L00208F
|
|
008F 00208F: A2 00 LDX #False
|
|
0091 002091: A0 24 LDY #$24
|
|
0093 002093: 60 RTS
|
|
0094 002094:
|
|
0094 **--------------------------------------------------------------
|
|
0094 _L002094
|
|
0094 002094: A9 00 LDA #False
|
|
0096 002096: AA TAX
|
|
0097 _L002097
|
|
0097 002097: 9D 00 22 STA $2200,x
|
|
009A 00209A: 9D 00 23 STA $2300,x
|
|
009D 00209D: 9D 00 24 STA $2400,x
|
|
00A0 0020A0: E8 INX
|
|
00A1 0020A1: D0 F4 BNE L002097 ; {-0C}
|
|
00A3 0020A3: 60 RTS
|
|
00A4 0020A4:
|
|
00A4 **--------------------------------------------------------------
|
|
00A4 _L0020A4
|
|
00A4 0020A4: A0 21 LDY #$21 ; "INPUT A?"
|
|
00A6 0020A6: D0 0E BNE L0020B6 ; {+0E}
|
|
00A8 _L0020A8
|
|
00A8 0020A8: A0 2B LDY #$2B ; "INPUT B?"
|
|
00AA 0020AA: D0 0A BNE L0020B6 ; {+0A}
|
|
00AC _L0020AC
|
|
00AC 0020AC: A0 54 LDY #$54 ; "= "
|
|
00AE 0020AE: D0 06 BNE L0020B6 ; {+06}
|
|
00B0 _L0020B0
|
|
00B0 0020B0: A0 35 LDY #$35 ; "WARNING: ..."
|
|
00B2 0020B2: D0 02 BNE L0020B6 ; {+02}
|
|
00B4 _L0020B4
|
|
00B4 0020B4: A0 00 LDY #0 ; "RUSSIAN PEASANT MULTIPLICATION"
|
|
00B6 _L0020B6
|
|
00B6 0020B6: B9 75 21 LDA L002175,y
|
|
00B9 0020B9: F0 06 BEQ L0020C1 ; {+06}
|
|
00BB 0020BB: 20 ED FD JSR COUT
|
|
00BE 0020BE: C8 INY
|
|
00BF 0020BF: D0 F5 BNE L0020B6 ; {-0B}
|
|
00C1 _L0020C1
|
|
00C1 0020C1: 60 RTS
|
|
00C2 0020C2:
|
|
00C2 **--------------------------------------------------------------
|
|
00C2 _L0020C2
|
|
00C2 0020C2: A9 8D LDA #$8D
|
|
00C4 0020C4: 4C ED FD JMP COUT
|
|
00C7 0020C7:
|
|
00C7 **--------------------------------------------------------------
|
|
00C7 0020C7: 20 85 20 JSR L002085
|
|
00CA 0020CA: D0 08 BNE L0020D4 ; {+08}
|
|
00CC 0020CC: 20 8A 20 JSR L00208A
|
|
00CF 0020CF: D0 03 BNE L0020D4 ; {+03}
|
|
00D1 _L0020D1
|
|
00D1 0020D1: 20 8F 20 JSR L00208F
|
|
00D4 _L0020D4
|
|
00D4 0020D4: 8E DF 20 STX L0020DF
|
|
00D7 0020D7: 8C E0 20 STY L0020E0
|
|
00DA 0020DA: A2 00 LDX #False
|
|
00DC 0020DC: A0 FF LDY #$FF
|
|
00DE _L0020DE
|
|
00DE 0020DE: B9 FF FF LDA $FFFF,y
|
|
00E1 _L0020DF
|
|
00E1 _L0020E0
|
|
00E1 0020E1: D0 04 BNE L0020E7 ; {+04}
|
|
00E3 0020E3: E0 00 CPX #False
|
|
00E5 0020E5: F0 07 BEQ L0020EE ; {+07}
|
|
00E7 _L0020E7
|
|
00E7 0020E7: 18 CLC
|
|
00E8 0020E8: 69 B0 ADC #$B0
|
|
00EA 0020EA: AA TAX
|
|
00EB 0020EB: 20 ED FD JSR COUT
|
|
00EE _L0020EE
|
|
00EE 0020EE: 88 DEY
|
|
00EF 0020EF: C0 FF CPY #$FF
|
|
00F1 0020F1: D0 EB BNE L0020DE ; {-15}
|
|
00F3 0020F3: A9 00 LDA #False
|
|
00F5 0020F5: A8 TAY
|
|
00F6 0020F6: E0 00 CPX #False
|
|
00F8 0020F8: F0 ED BEQ L0020E7 ; {-13}
|
|
00FA 0020FA: D0 C6 BNE L0020C2 ; {-3A}
|
|
00FC _L0020FC
|
|
00FC 0020FC: A0 00 LDY #False
|
|
00FE 0020FE: 18 CLC
|
|
00FF _L0020FF
|
|
00FF 0020FF: B9 00 24 LDA $2400,y
|
|
0102 002102: 79 00 22 ADC $2200,y
|
|
0105 002105: C9 0A CMP #$0A
|
|
0107 002107: 90 02 BCC L00210B ; {+02}
|
|
0109 002109: E9 0A SBC #$0A
|
|
010B _L00210B
|
|
010B 00210B: 99 00 24 STA $2400,y
|
|
010E 00210E: C8 INY
|
|
010F 00210F: D0 EE BNE L0020FF ; {-12}
|
|
0111 002111: 60 RTS
|
|
0112 002112:
|
|
0112 **--------------------------------------------------------------
|
|
0112 _L002112
|
|
0112 002112: A0 00 LDY #False
|
|
0114 002114: B9 00 23 LDA $2300,y
|
|
0117 002117: 29 01 AND #$01
|
|
0119 002119: F0 0E BEQ L002129 ; {+0E}
|
|
011B 00211B: D0 0A BNE L002127 ; {+0A}
|
|
011D _L00211D
|
|
011D 00211D: A0 00 LDY #False
|
|
011F _L00211F
|
|
011F 00211F: B9 00 23 LDA $2300,y
|
|
0122 002122: D0 05 BNE L002129 ; {+05}
|
|
0124 002124: C8 INY
|
|
0125 002125: D0 F8 BNE L00211F ; {-08}
|
|
0127 _L002127
|
|
0127 002127: 38 SEC
|
|
0128 002128: 60 RTS
|
|
0129 002129:
|
|
0129 **--------------------------------------------------------------
|
|
0129 _L002129
|
|
0129 002129: 18 CLC
|
|
012A 00212A: 60 RTS
|
|
012B 00212B:
|
|
012B **--------------------------------------------------------------
|
|
012B _L00212B
|
|
012B 00212B: A0 00 LDY #False
|
|
012D 00212D: 18 CLC
|
|
012E _L00212E
|
|
012E 00212E: B9 00 22 LDA $2200,y
|
|
0131 002131: AA TAX
|
|
0132 002132: BD 61 21 LDA L002161,x
|
|
0135 002135: 69 00 ADC #False
|
|
0137 002137: 99 00 22 STA $2200,y
|
|
013A 00213A: BD 6B 21 LDA L00216B,x
|
|
013D 00213D: 6A ROR A
|
|
013E 00213E: C8 INY
|
|
013F 00213F: D0 ED BNE L00212E ; {-13}
|
|
0141 002141: 60 RTS
|
|
0142 002142:
|
|
0142 **--------------------------------------------------------------
|
|
0142 _L002142
|
|
0142 002142: A0 FF LDY #$FF
|
|
0144 002144: A2 00 LDX #False
|
|
0146 002146: 86 FC STX $FC
|
|
0148 _L002148
|
|
0148 002148: 18 CLC
|
|
0149 002149: B9 00 23 LDA $2300,y
|
|
014C 00214C: 65 FC ADC $FC
|
|
014E 00214E: 6A ROR A
|
|
014F 00214F: 29 0F AND #$0F
|
|
0151 002151: 99 00 23 STA $2300,y
|
|
0154 002154: A9 00 LDA #False
|
|
0156 002156: 90 02 BCC L00215A ; {+02}
|
|
0158 002158: A9 0A LDA #$0A
|
|
015A _L00215A
|
|
015A 00215A: 85 FC STA $FC
|
|
015C 00215C: 88 DEY
|
|
015D 00215D: E8 INX
|
|
015E 00215E: D0 E8 BNE L002148 ; {-18}
|
|
0160 002160: 60 RTS
|
|
0161 002161:
|
|
0161 **--------------------------------------------------------------
|
|
0161 _L002161
|
|
0161 002161: 00 BRK
|
|
0162 002162: 02 DC I1'$02'
|
|
0163 002163: 04 06 TSB $06
|
|
0165 002165: 08 PHP
|
|
0166 002166: 00 BRK
|
|
0167 002167: 02 DC I1'$02'
|
|
0168 002168: 04 06 TSB $06
|
|
016A 00216A: 08 PHP
|
|
016B _L00216B
|
|
016B 00216B: 00 BRK
|
|
016C 00216C: 00 BRK
|
|
016D 00216D: 00 BRK
|
|
016E 00216E: 00 BRK
|
|
016F 00216F: 00 BRK
|
|
0170 002170: 01 DFB 1
|
|
0171 002171: 01 DFB 1
|
|
0172 002172: 01 DFB 1
|
|
0173 002173: 01 DFB 1
|
|
0174 002174: 01 DFB 1
|
|
0175 _L002175
|
|
0175 002175: D2 D5 D3 C9 ASC "RUSSIAN PEASANT MULTIPLICATION"
|
|
0179 00217A: C1 CE A0 D0
|
|
017E 00217E: C5 C1 D3 C1
|
|
0181 002182: CE D4 A0 CD
|
|
0186 002186: D5 CC D4 C9
|
|
0189 00218A: D0 CC C9 C3
|
|
018E 00218E: C1 D4 C9 CF
|
|
0192 002192: CE
|
|
0193 002193: 8D 8D DFB $8D, $8D
|
|
0195 002195: 00 DFB 0
|
|
0196 002196: C9 CE D0 D5 ASC "INPUT A"
|
|
019A 00219A: D4 A0 C1
|
|
019D 00219D: 8D DFB $8D
|
|
019E 00219E: BF ASC "?"
|
|
019F 00219F: 00
|
|
01A0 0021A0: C9 CE D0 D5 ASC "INPUT B"
|
|
01A4 0021A4: D4 A0 C2
|
|
01A7 0021A7: 8D DFB $8D
|
|
01A8 0021A8: BF ASC "?"
|
|
01A9 0021A9: 00
|
|
01AA 0021AA: 8D DFB $8D
|
|
01AB 0021AB: D7 C1 D2 CE ASC "WARNING: MORE THAN 127 CHARS"
|
|
01AF 0021AF: C9 CE C7 BA
|
|
01B3 0021B3: A0 CD CF D2
|
|
01B6 0021B7: C5 A0 D4 C8
|
|
01BB 0021BB: C1 CE A0 B1
|
|
01BF 0021BF: B2 B7 A0 C3
|
|
01C3 0021C3: C8 C1 D2 D3
|
|
01C7 0021C7: 8D DFB $8D
|
|
01C8 0021C8: 00 DFB 0
|
|
01C8 0021C9: BD A0 ASC "= "
|
|
01CB 0021CB: 00 DFB 0
|
|
|