1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 04:28:06 +11:00
collapseos/blk/308
Virgil Dupras e31527f5ac Add word ROT>
There are many situations where it can be useful. Worth it.
2020-10-29 12:41:08 -04:00

17 lines
416 B
Plaintext

CODE ROT ( a b c -- b c a )
HL POP, ( C ) DE POP, ( B ) IY POP, ( A ) chkPS,
DE PUSH, ( B ) HL PUSH, ( C ) IY PUSH, ( A )
;CODE
CODE ROT> ( a b c -- c a b )
HL POP, ( C ) DE POP, ( B ) IY POP, ( A ) chkPS,
HL PUSH, ( C ) IY PUSH, ( A ) DE PUSH, ( B )
;CODE
CODE DUP ( a -- a a )
HL POP, chkPS,
HL PUSH, HL PUSH,
;CODE
CODE ?DUP
HL POP, chkPS, HL PUSH,
HLZ, IFNZ, HL PUSH, THEN,
;CODE