;=================================================
;routine: mult_soft
; fuction: 8-bit unsigned multiplier using
; shift-and-add algorithm
; input register:
; s3: multiplicand
; s4: multiplier
; output register
; s5: upper byte of product
; s6: lower byte of product
; temp registr: i
;=================================================
mult_soft:
load s5, 00
load i, 08
mult_loop:
sr0 s4
jump nc, shift_prod
add s5, s3
shidt_prod:
sra s5
sra s6
sub i, 01
jump nz, mult_loop
return
程式碼如上,因對此小弟看不懂,特地到貴版求助
請各位大大伸出援手幫幫我!
感激不盡