Modified stdlib to use stack rotations to timeshare heap registers.
[vvhitespace] / stdlib / debug.pvvs
index 6328cf8..4cc8a73 100644 (file)
@@ -6,6 +6,13 @@
 @   dumpheap (111000)
 @ Description:
 @   Dumps the heap from 'startaddr' to 'endaddr'.
 @   dumpheap (111000)
 @ Description:
 @   Dumps the heap from 'startaddr' to 'endaddr'.
+@   This subroutine stomps on heap[1] after printing the first heap location.
+@     If you dump starting from heap[0], then heap[1] will print inaccurately.
+@     Starting the dump from any other location will work without error.
+@     TODO: Should I use heap[0] and DIE rather than RTS?
+@           At the moment, the ability to continue is too useful to me.
+@           If it's useful to me, it's probably useful to other people.
+@           For now, leave dumpheap as-is.
 @ Call Stack:
 @   endaddr
 @   startaddr  <-- TOS
 @ Call Stack:
 @   endaddr
 @   startaddr  <-- TOS
@@ -27,7 +34,7 @@ SSSTTTSTSN               | PUSH ASCII ':'
 SSSTSSTN                 | PUSH ASCII '\t'
 TNSS                     | PUTC
 TNSS                     | PUTC
 SSSTSSTN                 | PUSH ASCII '\t'
 TNSS                     | PUTC
 TNSS                     | PUTC
-NSTTSTSN                 | JSR>1010 (print number from stack)
+NSTTSSTN                 | JSR>1001 (print number from stack)
 SSSTSTSN                 | PUSH ASCII '\n'
 TNSS                     | PUTC
 
 SSSTSTSN                 | PUSH ASCII '\n'
 TNSS                     | PUTC
 
@@ -72,7 +79,7 @@ SSSTSSTN                 | PUSH ASCII '\t'
 TNSS                     | PUTC
 TNSS                     | PUTC
 SNT                      | SWAP
 TNSS                     | PUTC
 TNSS                     | PUTC
 SNT                      | SWAP
-NSTTSTSN                 | JSR>1010 (print number from stack)
+NSTTSSTN                 | JSR>1001 (print number from stack)
 SSSTSTSN                 | PUSH ASCII '\n'
 TNSS                     | PUTC
 
 SSSTSTSN                 | PUSH ASCII '\n'
 TNSS                     | PUTC