mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 23:58:05 +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
|
push hl
|
||||||
jp next
|
jp next
|
||||||
|
|
||||||
.fill 42
|
.fill 65
|
||||||
|
|
||||||
; ( 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
|
|
||||||
|
|
||||||
.db "_bend"
|
.db "_bend"
|
||||||
.dw $-CMP
|
.dw $-PLUS
|
||||||
.db 5
|
.db 5
|
||||||
; Offset: 06ee
|
; Offset: 06ee
|
||||||
.out $
|
.out $
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
( The NOT is to normalize the negative/positive numbers to 1
|
( The NOT is to normalize the negative/positive numbers to 1
|
||||||
or 0. Hadn't we wanted to normalize, we'd have written:
|
or 0. Hadn't we wanted to normalize, we'd have written:
|
||||||
32 CMP 1 - )
|
32 CMP 1 - )
|
||||||
: WS? 33 CMP 1 + NOT ;
|
: WS? 33 _c CMP 1 + NOT ;
|
||||||
|
|
||||||
: TOWORD
|
: TOWORD
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -266,3 +266,14 @@ CODE SCMP
|
|||||||
BC PUSHqq,
|
BC PUSHqq,
|
||||||
;CODE
|
;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