mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 22:38:06 +11:00
forth: fix "NOT"
Ouh, I need a solution here...
This commit is contained in:
parent
ea5f33558a
commit
d8542f7cf7
@ -658,6 +658,7 @@ CONSTANT:
|
|||||||
.dw FETCH
|
.dw FETCH
|
||||||
.dw EXIT
|
.dw EXIT
|
||||||
|
|
||||||
|
; TODO: find a way to express IF/THEN/ELSE in core dict more easily.
|
||||||
; ( f -- f )
|
; ( f -- f )
|
||||||
; IF 0 ELSE 1 THEN
|
; IF 0 ELSE 1 THEN
|
||||||
.db "NOT"
|
.db "NOT"
|
||||||
@ -665,13 +666,14 @@ CONSTANT:
|
|||||||
.dw CONSTANT
|
.dw CONSTANT
|
||||||
NOT:
|
NOT:
|
||||||
.dw compiledWord
|
.dw compiledWord
|
||||||
.dw IF
|
.dw CBRANCH
|
||||||
|
.db 8
|
||||||
.dw NUMBER
|
.dw NUMBER
|
||||||
.dw 0
|
.dw 0
|
||||||
.dw ELSE
|
.dw BRANCH
|
||||||
|
.db 5
|
||||||
.dw NUMBER
|
.dw NUMBER
|
||||||
.dw 1
|
.dw 1
|
||||||
.dw THEN
|
|
||||||
.dw EXIT
|
.dw EXIT
|
||||||
|
|
||||||
; ( n1 n2 -- f )
|
; ( n1 n2 -- f )
|
||||||
|
Loading…
Reference in New Issue
Block a user