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