@ stackrotate
@ Description:
@ Maximum rotation depth is 14. Stomps on heap[1]-heap[15].
+@ Assumes rotation depth is at least 2.
@ Call Stack:
@ stack word n
@ ...
@ For the convenience of other functions, modulo the
@ rotation depth by the available registers.
-SSSTTTSN | PUSH 14
+SSSTTTTN | PUSH 15
TSTT | MODULO
@ Use heap[15] for generating register addresses.
+@ TODO: Switch to using heap[1] so number of registers is limited only by user.
SSSTTTTN | PUSH 15 (ptr)
SSSSN | PUSH 0
TTS | STORE
@ stackrotatereverse
@ Description:
@ Maximum rotation depth is 14. Stomps on heap[1]-heap[15].
+@ Assumes rotation depth is at least 2.
@ Call Stack:
@ stack word n
@ ...
@ For the convenience of other functions, modulo the
@ rotation depth by the available registers.
-SSSTTTSN | PUSH 14
+SSSTTTTN | PUSH 15
TSTT | MODULO
@ Use heap[15] for generating register addresses.
+@ TODO: Switch to using heap[1] so number of registers is limited only by user.
SSSTTTTN | PUSH 15 (ptr)
SSSSN | PUSH 0
TTS | STORE