1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 17:18:05 +11:00

forth: fix "NOT"

Ouh, I need a solution here...
This commit is contained in:
Virgil Dupras 2020-03-11 19:59:10 -04:00
parent ea5f33558a
commit d8542f7cf7

View File

@ -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 )