mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 15:58:05 +11:00
forth: Forth-ify "SWAP"
This commit is contained in:
parent
cc4700e389
commit
d09ec0d757
Binary file not shown.
@ -928,22 +928,10 @@ DROP:
|
||||
pop hl
|
||||
jp next
|
||||
|
||||
; ( a b -- b a )
|
||||
.db "SWAP"
|
||||
.dw $-DROP
|
||||
.db 4
|
||||
SWAP:
|
||||
.dw nativeWord
|
||||
pop hl
|
||||
call chkPS
|
||||
ex (sp), hl
|
||||
push hl
|
||||
jp next
|
||||
|
||||
.fill 149
|
||||
.fill 167
|
||||
|
||||
.db "_bend"
|
||||
.dw $-SWAP
|
||||
.dw $-DROP
|
||||
.db 5
|
||||
; Offset: 06ee
|
||||
.out $
|
||||
|
@ -122,7 +122,7 @@
|
||||
( Adjust HERE -1 because SCPY copies the null )
|
||||
HERE @ 1 _c - ( h h' )
|
||||
_c DUP HERE ! ( h h' )
|
||||
SWAP _c - ( sz )
|
||||
_c SWAP _c - ( sz )
|
||||
( write prev value )
|
||||
HERE @ CURRENT @ _c - ,
|
||||
( write size )
|
||||
|
@ -39,6 +39,15 @@ CODE DUP
|
||||
HL PUSHqq, ( A )
|
||||
;CODE
|
||||
|
||||
( a b -- b a )
|
||||
CODE SWAP
|
||||
HL POPqq, ( B )
|
||||
DE POPqq, ( A )
|
||||
chkPS,
|
||||
HL PUSHqq, ( B )
|
||||
DE PUSHqq, ( A )
|
||||
;CODE
|
||||
|
||||
( a b -- a b a )
|
||||
CODE OVER
|
||||
HL POPqq, ( B )
|
||||
|
Loading…
Reference in New Issue
Block a user