mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
Fixed +loop
This commit is contained in:
parent
3411fec40d
commit
d014418bb4
1 changed files with 11 additions and 3 deletions
14
bootstrap.fs
14
bootstrap.fs
|
@ -1473,16 +1473,24 @@ do-stack 16 cells + do-sp !
|
|||
compile rdrop
|
||||
; immediate
|
||||
|
||||
\ This code is take from Gforth
|
||||
: crossed-boundary? ( d n i )
|
||||
swap - ( d i-n )
|
||||
2dup + ( d i-n i+d-n )
|
||||
over xor ( d i-n (i-n)^(i+d-n) )
|
||||
>r xor r> ( d^(i-n) (i^n)^(i+d-n) )
|
||||
and 0<
|
||||
;
|
||||
|
||||
: +loop
|
||||
compile r>
|
||||
compile r>
|
||||
compile 3dup
|
||||
compile rot
|
||||
compile over
|
||||
compile +
|
||||
compile >r
|
||||
compile over
|
||||
compile >r
|
||||
compile =
|
||||
compile crossed-boundary?
|
||||
compile 0branch
|
||||
here cell + backpatch-leave \ leave jumps to here
|
||||
do> drop \ do-mark
|
||||
|
|
Loading…
Reference in a new issue