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

forth: Forth-ify "SCMP"

This commit is contained in:
Virgil Dupras 2020-03-28 15:14:15 -04:00
parent 400ef99b54
commit 7c9d799d93
3 changed files with 17 additions and 17 deletions

Binary file not shown.

View File

@ -122,6 +122,8 @@ LIT:
.dw litWord
.dw INITIAL_SP
.dw WORDBUF
jp flagsToBC
jp strcmp
; *** Code ***
forthMain:
@ -180,7 +182,7 @@ INTERPRET:
.dw DROP
.dw EXECUTE
.fill 56
.fill 50
; STABLE ABI
; Offset: 00cd
@ -980,25 +982,11 @@ PLUS:
push hl
jp next
.fill 18
; ( a1 a2 -- b )
.db "SCMP"
.dw $-PLUS
.db 4
SCMP:
.dw nativeWord
pop de
pop hl
call chkPS
call strcmp
call flagsToBC
push bc
jp next
.fill 42
; ( n1 n2 -- f )
.db "CMP"
.dw $-SCMP
.dw $-PLUS
.db 3
CMP:
.dw nativeWord

View File

@ -254,3 +254,15 @@ CODE (resSP)
( INITIAL_SP == JTBL+28 )
SP JTBL 28 + @ LDdd(nn),
;CODE
CODE SCMP
DE POPqq,
HL POPqq,
chkPS,
( JTBL+35 == strcmp )
JTBL 35 + CALLnn,
( JTBL+32 == flagsToBC )
JTBL 32 + CALLnn,
BC PUSHqq,
;CODE