Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *=$C000
- ; 120 x 100 = 12000(d) = $2EE0(h)
- ; Register X will hold multiplier
- ; Accumulator will hold multplicand
- ; HB of the Result in Accumulator
- ; LB of the Result in Register X
- MULTPLICAND = $FC
- RESULT_HB = $FB
- ; 0 is assumed at $FB and $FC
- LDX #100 ; X=MPR
- LDA #120 ; Acc=MPCND
- STA MULTPLICAND
- LDA #00
- LOOP
- DEX
- BMI STOP
- CLC
- ADC MULTPLICAND
- BCC LOOP
- INC RESULT_HB ; INY if Y register used instead
- JMP LOOP
- STOP
- TAX
- LDA RESULT_HB ; TYA if Y register used instead
Advertisement
Add Comment
Please, Sign In to add comment