X-Git-Url: http://git.subgeniuskitty.com/vvhitespace/.git/blobdiff_plain/bb21580a5abba6a1e6666e9fb363f68d40f785d7..23d1724712fae7dc9645d862d57d030cf3e2e764:/stdlib/debug.pvvs diff --git a/stdlib/debug.pvvs b/stdlib/debug.pvvs index 5261984..138b2cb 100644 --- a/stdlib/debug.pvvs +++ b/stdlib/debug.pvvs @@ -22,12 +22,12 @@ TTT | LOAD SNT | SWAP @ Print output line for this memory location -NSTTSSSSSTN | JSR>1000001 (print absolute value of number) +NSTTSSSSTTN | JSR>1000011 (print absolute value of number) SSSTTTSTSN | PUSH ASCII ':' 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 @@ -51,4 +51,41 @@ NSSVSSTTTSSSSSSSSSSSN | Mark: 00111000 00000000 SNN | DROP NTN | RTS +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ Name: +@ dumpstack (111001) +@ Description: +@ Dumps 'count' entries from the stack. +@ Call Stack: +@ count <-- TOS +@ Return Stack: +@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +#include +NSSVTTTSSTN | Mark: 111001 (dump stack) + +@ Print output line for the current TOS. +SNS | DUP +NSTTSSSSTTN | JSR>1000011 (print absolute value of number) +SSSTTTSTSN | PUSH ASCII ':' +SSSTSSTN | PUSH ASCII '\t' +TNSS | PUTC +TNSS | PUTC +SNT | SWAP +NSTTSSTN | JSR>1001 (print number from stack) +SSSTSTSN | PUSH ASCII '\n' +TNSS | PUTC + +@ Figure out if the loop is complete. +SNS | DUP +NTSSSTTTSSTSSSSSSSSN | BRZ > 00111001 00000000 +SSSTN | PUSH 1 +TSST | SUBTRACT +NSNTTTSSTN | JMP>111001 (dump stack) + +@ Clean up and return +NSSVSSTTTSSTSSSSSSSSN | Mark: 00111001 00000000 +SNN | DROP +NTN | RTS + #endif