aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/msp430/words/q-branch.asm
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/msp430/words/q-branch.asm')
-rw-r--r--amforth-6.5/msp430/words/q-branch.asm7
1 files changed, 7 insertions, 0 deletions
diff --git a/amforth-6.5/msp430/words/q-branch.asm b/amforth-6.5/msp430/words/q-branch.asm
new file mode 100644
index 0000000..5ec1563
--- /dev/null
+++ b/amforth-6.5/msp430/words/q-branch.asm
@@ -0,0 +1,7 @@
+;Z ?branch x -- branch if TOS zero
+ CODEHEADER(XT_DOCONDBRANCH,7,"?branch")
+ ADD #0,TOS ; 1 test TOS value
+ MOV @PSP+,TOS ; 2 pop new TOS value (doesn't change flags)
+ JZ dobran ; 2 if TOS was zero, take the branch
+ ADD #2,IP ; 1 else skip the branch destination
+ NEXT ; 4