Author: blueswirl
Date: 2009-04-28 18:40:49 +0200 (Tue, 28 Apr 2009)
New Revision: 485
Modified:
trunk/openbios-devel/forth/device/fcode.fs
Log:
Fix various bugs in bbranch and b?branch implementations (Mark Cave-Ayland)
Modified: trunk/openbios-devel/forth/device/fcode.fs
===================================================================
--- trunk/openbios-devel/forth/device/fcode.fs 2009-04-13 17:05:41 UTC (rev 484)
+++ trunk/openbios-devel/forth/device/fcode.fs 2009-04-28 16:40:49 UTC (rev 485)
@@ -438,22 +438,27 @@
\ Unconditional branch FCode. Followed by FCode-offset.
: bbranch
- ['] dobranch ,
fcode-offset 0< if \ if we jump backwards, we can forsee where it goes
+ ['] dobranch ,
+ swap
resolve-dest
+ execute-tmp-comp
else
+ setup-tmp-comp ['] dobranch ,
here
0 ,
+ swap
then
; immediate
-
+
\ b?branch ( continue? -- )
\ Conditional branch FCode. Followed by FCode-offset.
: b?branch
fcode-offset 0< if \ if we jump backwards, we can forsee where it goes
- resolve-orig
+ ['] do?branch ,
+ resolve-dest
execute-tmp-comp
else
setup-tmp-comp ['] do?branch ,
@@ -468,10 +473,7 @@
: b(<mark)
setup-tmp-comp
- ['] invert ,
- ['] do?branch ,
here
- 0 ,
; immediate