aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/msp430/words/lshift.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/msp430/words/lshift.asm')
-rw-r--r--amforth-6.5/msp430/words/lshift.asm10
1 files changed, 10 insertions, 0 deletions
diff --git a/amforth-6.5/msp430/words/lshift.asm b/amforth-6.5/msp430/words/lshift.asm
new file mode 100644
index 0000000..810d680
--- /dev/null
+++ b/amforth-6.5/msp430/words/lshift.asm
@@ -0,0 +1,10 @@
+;C LSHIFT x1 u -- x2 logical L shift u places
+ CODEHEADER(LSHIFT,6,"lshift")
+ MOV @PSP+,W
+ AND #1Fh,TOS ; no need to shift more than 16
+ JZ LSH_X
+LSH_1: ADD W,W
+ SUB #1,TOS
+ JNZ LSH_1
+LSH_X: MOV W,TOS
+ NEXT