Updated 'Hello, World!' example to print using stdlib.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Thu, 11 Jul 2019 11:43:22 +0000 (04:43 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Thu, 11 Jul 2019 11:43:22 +0000 (04:43 -0700)
examples/hello-stdlib/hello.pvvs [new file with mode: 0644]
examples/hello-world/hello.pvvs [new file with mode: 0644]
examples/hello.pvvs [deleted file]

diff --git a/examples/hello-stdlib/hello.pvvs b/examples/hello-stdlib/hello.pvvs
new file mode 100644 (file)
index 0000000..628fa7e
--- /dev/null
@@ -0,0 +1,18 @@
+## This program outputs "Hello, world!"
+
+SSSSN           | ST: Push +0 (ASCII '\0')
+SSSTSSSSTN      | ST: Push +33 (ASCII !)
+SSSTTSSTSSN     | ST: Push +100 (ASCII d)
+SSSTTSTTSSN     | ST: Push +108 (ASCII l)
+SSSTTTSSTSN     | ST: Push +114 (ASCII r)
+SSSTTSTTTTN     | ST: Push +111 (ASCII o)
+SSSTTTSTTTN     | ST: Push +119 (ASCII w)
+SSSTSSSSSN      | ST: Push +32 (ASCII space)
+SSSTSTTSSN      | ST: Push +44 (ASCII ,)
+SSSTTSTTTTN     | ST: Push +111 (ASCII o)
+SSSTTSTTSSN     | ST: Push +108 (ASCII l)
+SSSTTSTTSSN     | ST: Push +108 (ASCII l)
+SSSTTSSTSTN     | ST: Push +101 (ASCII e)
+SSSTSSTSSSN     | ST: Push +72 (ASCII H)
+NSTTSSSN        | FC: JSR>1000 (print string from stack; see stdlib)
+NNN             | FC: Terminate program
diff --git a/examples/hello-world/hello.pvvs b/examples/hello-world/hello.pvvs
new file mode 100644 (file)
index 0000000..145fe1c
--- /dev/null
@@ -0,0 +1,30 @@
+## This program outputs "Hello, world!"
+## It was copied from Wikipedia.
+
+SSSTSSTSSSN     | ST: Push +72 (ASCII H)
+TNSS            | IO: Output character
+SSSTTSSTSTN     | ST: Push +101 (ASCII e)
+TNSS            | IO: Output character
+SSSTTSTTSSN     | ST: Push +108 (ASCII l)
+TNSS            | IO: Output character
+SSSTTSTTSSN     | ST: Push +108 (ASCII l)
+TNSS            | IO: Output character
+SSSTTSTTTTN     | ST: Push +111 (ASCII o)
+TNSS            | IO: Output character
+SSSTSTTSSN      | ST: Push +44 (ASCII ,)
+TNSS            | IO: Output character
+SSSTSSSSSN      | ST: Push +32 (ASCII space)
+TNSS            | IO: Output character
+SSSTTTSTTTN     | ST: Push +119 (ASCII w)
+TNSS            | IO: Output character
+SSSTTSTTTTN     | ST: Push +111 (ASCII o)
+TNSS            | IO: Output character
+SSSTTTSSTSN     | ST: Push +114 (ASCII r)
+TNSS            | IO: Output character
+SSSTTSTTSSN     | ST: Push +108 (ASCII l)
+TNSS            | IO: Output character
+SSSTTSSTSSN     | ST: Push +100 (ASCII d)
+TNSS            | IO: Output character
+SSSTSSSSTN      | ST: Push +33 (ASCII !)
+TNSS            | IO: Output character
+NNN             | FC: Terminate program
diff --git a/examples/hello.pvvs b/examples/hello.pvvs
deleted file mode 100644 (file)
index 145fe1c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-## This program outputs "Hello, world!"
-## It was copied from Wikipedia.
-
-SSSTSSTSSSN     | ST: Push +72 (ASCII H)
-TNSS            | IO: Output character
-SSSTTSSTSTN     | ST: Push +101 (ASCII e)
-TNSS            | IO: Output character
-SSSTTSTTSSN     | ST: Push +108 (ASCII l)
-TNSS            | IO: Output character
-SSSTTSTTSSN     | ST: Push +108 (ASCII l)
-TNSS            | IO: Output character
-SSSTTSTTTTN     | ST: Push +111 (ASCII o)
-TNSS            | IO: Output character
-SSSTSTTSSN      | ST: Push +44 (ASCII ,)
-TNSS            | IO: Output character
-SSSTSSSSSN      | ST: Push +32 (ASCII space)
-TNSS            | IO: Output character
-SSSTTTSTTTN     | ST: Push +119 (ASCII w)
-TNSS            | IO: Output character
-SSSTTSTTTTN     | ST: Push +111 (ASCII o)
-TNSS            | IO: Output character
-SSSTTTSSTSN     | ST: Push +114 (ASCII r)
-TNSS            | IO: Output character
-SSSTTSTTSSN     | ST: Push +108 (ASCII l)
-TNSS            | IO: Output character
-SSSTTSSTSSN     | ST: Push +100 (ASCII d)
-TNSS            | IO: Output character
-SSSTSSSSTN      | ST: Push +33 (ASCII !)
-TNSS            | IO: Output character
-NNN             | FC: Terminate program