mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 12:18:07 +11:00
forth: Forth-ify "CMP"
forth.asm under 1K lines!
This commit is contained in:
parent
7c9d799d93
commit
a2c258afba
Binary file not shown.
@ -982,25 +982,9 @@ PLUS:
|
||||
push hl
|
||||
jp next
|
||||
|
||||
.fill 42
|
||||
|
||||
; ( n1 n2 -- f )
|
||||
.db "CMP"
|
||||
.dw $-PLUS
|
||||
.db 3
|
||||
CMP:
|
||||
.dw nativeWord
|
||||
pop hl
|
||||
pop de
|
||||
call chkPS
|
||||
or a ; clear carry
|
||||
sbc hl, de
|
||||
call flagsToBC
|
||||
push bc
|
||||
jp next
|
||||
|
||||
.fill 65
|
||||
.db "_bend"
|
||||
.dw $-CMP
|
||||
.dw $-PLUS
|
||||
.db 5
|
||||
; Offset: 06ee
|
||||
.out $
|
||||
|
@ -81,7 +81,7 @@
|
||||
( The NOT is to normalize the negative/positive numbers to 1
|
||||
or 0. Hadn't we wanted to normalize, we'd have written:
|
||||
32 CMP 1 - )
|
||||
: WS? 33 CMP 1 + NOT ;
|
||||
: WS? 33 _c CMP 1 + NOT ;
|
||||
|
||||
: TOWORD
|
||||
BEGIN
|
||||
|
@ -266,3 +266,14 @@ CODE SCMP
|
||||
BC PUSHqq,
|
||||
;CODE
|
||||
|
||||
CODE CMP
|
||||
HL POPqq,
|
||||
DE POPqq,
|
||||
chkPS,
|
||||
A ORr, ( clear carry )
|
||||
DE SBCHLss,
|
||||
( JTBL+32 == flagsToBC )
|
||||
JTBL 32 + CALLnn,
|
||||
BC PUSHqq,
|
||||
;CODE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user