aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/avr8/words/lshift.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/avr8/words/lshift.asm')
-rw-r--r--amforth-6.5/avr8/words/lshift.asm22
1 files changed, 22 insertions, 0 deletions
diff --git a/amforth-6.5/avr8/words/lshift.asm b/amforth-6.5/avr8/words/lshift.asm
new file mode 100644
index 0000000..2016525
--- /dev/null
+++ b/amforth-6.5/avr8/words/lshift.asm
@@ -0,0 +1,22 @@
+; ( n1 n2 -- n3)
+; Arithmetics
+; logically shift n1 left n2 times
+VE_LSHIFT:
+ .dw $ff06
+ .db "lshift"
+ .dw VE_HEAD
+ .set VE_HEAD = VE_LSHIFT
+XT_LSHIFT:
+ .dw PFA_LSHIFT
+PFA_LSHIFT:
+ movw zl, tosl
+ loadtos
+PFA_LSHIFT1:
+ sbiw zl, 1
+ brmi PFA_LSHIFT2
+ lsl tosl
+ rol tosh
+ rjmp PFA_LSHIFT1
+PFA_LSHIFT2:
+ jmp_ DO_NEXT
+