Added slurp & spew functions to VVS stdlib.
[vvhitespace] / stdlib / stdio.pvvs
index e0ff711..12e0ed7 100644 (file)
@@ -2,8 +2,10 @@
 #define VVS_STDLIB_STDIO
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 #define VVS_STDLIB_STDIO
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@ Name:
+@   printstackstring (1000)
 @ Description:
 @ Description:
-@   This function prints a null-terminated string from the stack.
+@   Prints a null-terminated string from the stack.
 @ Call Stack:
 @   null-terminator (ASCII '\0')
 @   char n
 @ Call Stack:
 @   null-terminator (ASCII '\0')
 @   char n
@@ -23,8 +25,10 @@ SNN                     | DROP
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@ Name:
+@   printheapstring (1001)
 @ Description:
 @ Description:
-@   This function prints a null-terminated string from the heap.
+@   Prints a null-terminated string from the heap.
 @ Call Stack:
 @   pointer to first character  <-- TOS
 @ Return Stack:
 @ Call Stack:
 @   pointer to first character  <-- TOS
 @ Return Stack:
@@ -45,11 +49,13 @@ SNN                     | DROP
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@ Name:
+@   printstacknumber (1010)
 @ Description:
 @ Description:
-@   This functions prints a number from the stack in sign-magnitude format.
+@   Prints 'number' from the stack in sign-magnitude format.
 @   Leading zeros are suppressed.
 @ Call Stack:
 @   Leading zeros are suppressed.
 @ Call Stack:
-@   number to print  <-- TOS
+@   number  <-- TOS
 @ Return Stack:
 @   <empty>
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @ Return Stack:
 @   <empty>
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ -60,10 +66,12 @@ NSTTSSSSSTN             | JSR > 1000001
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@ Name:
+@   printstacknumbersign (1000000)
 @ Description:
 @ Description:
-@   This functions prints the sign of a number from the stack.
+@   Prints the sign of 'number' from the stack.
 @ Call Stack:
 @ Call Stack:
-@   number to print  <-- TOS
+@   number  <-- TOS
 @ Return Stack:
 @   <empty>
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @ Return Stack:
 @   <empty>
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ -78,13 +86,16 @@ TNSS                    | PUTC
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 NTN                     | RTS
 
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@ Name:
+@   printstacknumbermagnitude (1000001)
 @ Description:
 @ Description:
-@   This functions prints the magnitude of a number from the stack.
+@   Prints the magnitude of 'number' from the stack.
 @ Call Stack:
 @ Call Stack:
-@   number to print  <-- TOS
+@   number  <-- TOS
 @ Return Stack:
 @   <empty>
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @ Return Stack:
 @   <empty>
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+#include <math.pvvs>
 NSSVTSSSSSTN            | Mark: 1000001 (print magnitude of number from stack)
 NSTTSSSTN               | JSR > 10001 (absolute value)
 
 NSSVTSSSSSTN            | Mark: 1000001 (print magnitude of number from stack)
 NSTTSSSTN               | JSR > 10001 (absolute value)
 
@@ -115,6 +126,4 @@ SNN                     | DROP
 NSTTSSSN                | JSR > 1000 (print string from stack)
 NTN                     | RTS
 
 NSTTSSSN                | JSR > 1000 (print string from stack)
 NTN                     | RTS
 
-#include <math.pvvs>
-
 #endif
 #endif