mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
fixed a bug of begin-while-repeat loop
This commit is contained in:
parent
e2bdf855d4
commit
9d88c996d8
1 changed files with 4 additions and 4 deletions
|
@ -732,21 +732,21 @@ allot-cell : &find! [ ' L , , ] ; \ ( c-addr -- nt ) Throw exception at error
|
|||
here - , \ fill offset
|
||||
; immediate
|
||||
|
||||
\ compile: ( dest -- dest orig )
|
||||
\ compile: ( dest -- orig dest )
|
||||
\ runtime: ( n -- )
|
||||
\ dest=location of begin
|
||||
\ orig=location of while
|
||||
: while
|
||||
compile 0branch
|
||||
here 0 , \ save location, fill dummy
|
||||
here swap
|
||||
0 , \ save location, fill dummy
|
||||
; immediate
|
||||
|
||||
\ compile: ( dest orig -- )
|
||||
\ compile: ( orig dest -- )
|
||||
\ runtime: ( -- )
|
||||
\ dest=location of begin
|
||||
\ orig=location of while
|
||||
: repeat
|
||||
swap
|
||||
compile branch
|
||||
here - , \ fill offset from here to begin
|
||||
here over - swap ! \ backfill offset from while to here
|
||||
|
|
Loading…
Reference in a new issue