1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-28 08:28:06 +11:00

forth: Forth-ify "-"

This commit is contained in:
Virgil Dupras 2020-03-27 11:36:58 -04:00
parent 005dd98fc2
commit 941224be94
3 changed files with 11 additions and 14 deletions

Binary file not shown.

View File

@ -1318,23 +1318,11 @@ PLUS:
push hl
jp next
; ( a b -- c ) A - B
.db "-"
.dw $-PLUS
.db 1
MINUS:
.dw nativeWord
pop de ; B
pop hl ; A
call chkPS
or a ; reset carry
sbc hl, de
push hl
jp next
.fill 18
; ( a1 a2 -- b )
.db "SCMP"
.dw $-MINUS
.dw $-PLUS
.db 4
SCMP:
.dw nativeWord

View File

@ -113,6 +113,15 @@ CODE XOR
HL PUSHqq,
;CODE
CODE -
DE POPqq,
HL POPqq,
chkPS,
A ORr,
DE SBCHLss,
HL PUSHqq,
;CODE
CODE *
DE POPqq,
BC POPqq,