User Tools

Site Tools


base:16bit_multiplication_32-bit_product

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

base:16bit_multiplication_32-bit_product [2015-04-17 04:30] – external edit 127.0.0.1base:16bit_multiplication_32-bit_product [2018-09-04 23:32] (current) – Readability (syntax highlighting, indents) agentfriday
Line 1: Line 1:
 ====== 16-bit multiply with 32-bit product  ====== ====== 16-bit multiply with 32-bit product  ======
  
-<code>+<code 6502acme>
 ;16-bit multiply with 32-bit product  ;16-bit multiply with 32-bit product 
 ;took from 6502.org ;took from 6502.org
  
-multiplier = $f7  +multiplier = $f7  
-multiplicand = $f9  +multiplicand = $f9  
-product = $fb +product = $fb 
  
-mult16 lda #$00 +mult16  lda #$00 
-sta product+2 ; clear upper bits of product + sta product+2 ; clear upper bits of product 
-sta product+3  + sta product+3  
-ldx #$10 ; set binary count to 16  + ldx #$10 ; set binary count to 16  
-shift_r lsr multiplier+1 ; divide multiplier by 2  +shift_r lsr multiplier+1 ; divide multiplier by 2  
-ror multiplier + ror multiplier 
-bcc rotate_r  + bcc rotate_r  
-lda product+2 ; get upper half of product and add multiplicand + lda product+2 ; get upper half of product and add multiplicand 
-clc + clc 
-adc multiplicand + adc multiplicand 
-sta product+2 + sta product+2 
-lda product+3  + lda product+3  
-adc multiplicand+1 + adc multiplicand+1 
-rotate_r ror ; rotate partial product  +rotate_r ror ; rotate partial product  
-sta product+3  + sta product+3  
-ror product+2 + ror product+2 
-ror product+1  + ror product+1  
-ror product  + ror product  
-dex + dex 
-bne shift_r  + bne shift_r  
-rts+ rts
 </code> </code>
 +
base/16bit_multiplication_32-bit_product.txt · Last modified: 2018-09-04 23:32 by agentfriday