system using `cpp`.
--- /dev/null
+# (c) 2019 Aaron Taylor <ataylor at subgeniuskitty dot com>
+# All rights reserved.
+
+EXAMPLES != find . -mindepth 1 -maxdepth 1 -type d
+
+all:
+ @echo "No target available to build all."
+ @echo "Try 'make run' inside an example folder."
+
+clean:
+ @for dir in $(EXAMPLES); do \
+ echo Cleaning $$dir; \
+ (cd $$dir; ${MAKE} clean); \
+ done
--- /dev/null
+# (c) 2019 Aaron Taylor <ataylor at subgeniuskitty dot com>
+# All rights reserved.
+
+####################################################################################################
+# Configuration
+
+VVS_COMPILER = ../../vvc
+VVS_INTERPRETER = ../../vvi
+
+CPP = cpp
+CPP_FLAGS = -I../../stdlib
--- /dev/null
+# (c) 2019 Aaron Taylor <ataylor at subgeniuskitty dot com>
+# All rights reserved.
+
+include ../config.mk
+
+all: hello
+
+hello:
+ $(CPP) $(CPP_FLAGS) -o temp.pvvs hello.pvvs
+ $(VVS_COMPILER) -i temp.pvvs -o hello.vvs
+ @rm -f temp.pvvs
+
+run:
+ $(VVS_INTERPRETER) -i hello.vvs
+
+clean:
+ @rm -f hello.vvs temp.pvvs
-## This program outputs "Hello, world!"
+@@ This program outputs "Hello, world!"
SSSSN | ST: Push +0 (ASCII '\0')
SSSTSSSSTN | ST: Push +33 (ASCII !)
SSSTSSTSSSN | ST: Push +72 (ASCII H)
NSTTSSSN | FC: JSR>1000 (print string from stack; see stdlib)
NNN | FC: Terminate program
+
+#include "stdio.pvvs"
--- /dev/null
+# (c) 2019 Aaron Taylor <ataylor at subgeniuskitty dot com>
+# All rights reserved.
+
+include ../config.mk
+
+all: hello
+
+hello:
+ $(VVS_COMPILER) -i hello.pvvs -o hello.vvs
+
+run:
+ $(VVS_INTERPRETER) -i hello.vvs
+
+clean:
+ @rm -f hello.vvs
-################################################################################
-# Description:
-# This function prints a null-terminated string from the stack.
-# Call Stack:
-# null-terminator (ASCII '\0')
-# char n
-# ...
-# char 2
-# char 1 <-- TOS
-# Return Stack:
-# <empty>
-################################################################################
+#ifndef VVS_STDLIB_STDIO
+#define VVS_STDLIB_STDIO
+
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@ Description:
+@ This function prints a null-terminated string from the stack.
+@ Call Stack:
+@ null-terminator (ASCII '\0')
+@ char n
+@ ...
+@ char 2
+@ char 1 <-- TOS
+@ Return Stack:
+@ <empty>
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
NSSVTSSSN | Mark: 1000 (print string from stack)
SNS | DUP
NTSSSSSTSSSSSSSSSSTN | BRZ > 00001000 00000001
SNN | DROP
NTN | RTS
-################################################################################
-# Description:
-# This function prints a null-terminated string from the heap.
-# Call Stack:
-# pointer to first character <-- TOS
-# Return Stack:
-# <empty>
-################################################################################
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+@ Description:
+@ This function prints a null-terminated string from the heap.
+@ Call Stack:
+@ pointer to first character <-- TOS
+@ Return Stack:
+@ <empty>
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
NSSVTSSTN | Mark: 1001 (print string from heap)
SNS | DUP
TTT | LOAD
SNN | DROP
SNN | DROP
NTN | RTS
+
+#endif