📄 mult16.asm
字号:
; File Name Mult16.asm"
; Support Email Per@hum.au.dk
; Target MCU AT90Sxxxx
; R e v i s i o n H I S T O R Y
; rev. date who why
; ---- ------------ --- ---------------------------------------------------
; 0.01 May 17, 2001 PB Creation after a great idea from Thorleif Bundgaard
;
;.DEVICE AT90S4414 ; change if an other device is used
;.include "4414def.inc" ; change if an other device is used
.def Mult =r8
.def Base =r10
.def Base1 =r11
.def Base2 =r12 ; Base2 is just used as a adc zero ....
.def Lcount =r18
; Entry : Base * Mult
; Result :
; Int : Base1, Base
; 12 Words off program space
; Execution at 1 MHz. between 50 and 70 uS. depending on the input numbers
Mult32: ldi Lcount,8
mov Base1,Base ; Prepare "Shift reg"
clr Base
clr Base2
Mult1: add Base,Base ; Shift 32 bit register one bit left
adc Base1,Base1
brcc Mult2 ; No carry => Next
add Base,Mult ; Add Multiplicant
adc Base1,Base2 ; adc with zero to let carry ripple through
Mult2: dec Lcount ; Finished ?
brne Mult1 ; No, Loopback
ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -