RosettaCodeData/Task/Function-definition/6502-Assembly/function-definition-1.6502
2019-09-12 10:33:56 -07:00

8 lines
318 B
Text

MULTIPLY: STX MULN ; 6502 has no "acc += xreg" instruction,
TXA ; so use a memory address
MULLOOP: DEY
CLC ; remember to clear the carry flag before
ADC MULN ; doing addition or subtraction
CPY #$01
BNE MULLOOP
RTS