Guest User

Untitled

a guest
Aug 5th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;put multiplicand into mult1
  2. ;put multiplier into "multiplier"
  3.  
  4. lda #077h
  5. sta mult1
  6. lda #055h
  7. sta multiplier   ;multiply 77h by 55h
  8.  
  9.   lda #0
  10.   ldx #8
  11. - asl                ;shift result left + multiplicand
  12.   rol mult1
  13.   bcc +              ;if multiplicand bit is 0, we don't add multiplier to result
  14.   clc
  15.   adc multiplier     ;add multiplier to result
  16.   bcc +
  17.   inc mult1          ;add 1 to result if we get a carry
  18. + dex
  19.   bne -              ;loop 8 times to do all 8 bits
  20.   sta mult0
  21.  
  22. result is now in mult1/mult0
Add Comment
Please, Sign In to add comment