OPT PRT
-; runtimelib FOR 8080
+; runtimelib FOR 8080 using DE as the parameter stack pointer
; Joel Matthew Rees September 2020
; Borrowing some concepts from fig-Forth.
; Not tested!
+; In fact, I was never all that good with 8080 code,
+; and it has been almost 40 years, so ...
+; don't expect it to work without fixing it.
+; Patterned after 6800 libs.
; ------------------------------------LICENSE-------------------------------------
;
; IXSRC: DS ADRWDSZ ; source index pointer
; IXTERM: DS ADRWDSZ ; terminator for moves
+; ****
+; Any
+; Using DE for the parameter stack pointer means that
+; interrupts must *not* use the interrupted routine's parameter stack.
+;
+; If we used DE as the stack pointer, it could remain constant while HL indexed the stack.
+; But since we are indexing the stack with the stack pointer itself,
+; the stack pointer will often be out of position to protect the active contents.
+;
+; We could gamble and guess that six bytes or sixteen would be enough to avoid active stack,
+; but it will be better to just have the interrupt routines set their own parameter stacks.
+;
+; Note that using DE as the stack pointer would not mean we could use XCHG
+; to save the current pointer and index the stack, for reasons evident from the above.
+; ****