e31527f5ac
There are many situations where it can be useful. Worth it.
17 lines
416 B
Plaintext
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
|