aboutsummaryrefslogtreecommitdiff
path: root/docs/history/07-zygote/code/examples
diff options
context:
space:
mode:
Diffstat (limited to 'docs/history/07-zygote/code/examples')
-rw-r--r--docs/history/07-zygote/code/examples/asmain.s9
-rw-r--r--docs/history/07-zygote/code/examples/echo.s1
-rw-r--r--docs/history/07-zygote/code/examples/fact.s3
-rw-r--r--docs/history/07-zygote/code/examples/hello.s2
-rw-r--r--docs/history/07-zygote/code/examples/sm.s3
5 files changed, 18 insertions, 0 deletions
diff --git a/docs/history/07-zygote/code/examples/asmain.s b/docs/history/07-zygote/code/examples/asmain.s
new file mode 100644
index 0000000..96d9658
--- /dev/null
+++ b/docs/history/07-zygote/code/examples/asmain.s
@@ -0,0 +1,9 @@
+:;standalone:_source_on_Q,_binary_on_G
+4000 a.q !
+:m.rd ? m.ch z 0 a.q @ ! m.go j
+:m.ch , a.q @ ! a.q @ 1 + a.q ! m.rd j
+:m.go 4000 a.src ! 40000 a.dst ! 0 a.org ! 50000 a.lab ! a.run c 0 a.j !
+:m.out a.j @ a.n @ < m.end z
+ 40000 a.j @ + @ 0 $ . 0 $ 8 > . 0 $ 16 > . 24 > .
+ a.j @ 1 + a.j ! m.out j
+:m.end q
diff --git a/docs/history/07-zygote/code/examples/echo.s b/docs/history/07-zygote/code/examples/echo.s
new file mode 100644
index 0000000..002935d
--- /dev/null
+++ b/docs/history/07-zygote/code/examples/echo.s
@@ -0,0 +1 @@
+:l ? x z q :x , . l j
diff --git a/docs/history/07-zygote/code/examples/fact.s b/docs/history/07-zygote/code/examples/fact.s
new file mode 100644
index 0000000..21f6e32
--- /dev/null
+++ b/docs/history/07-zygote/code/examples/fact.s
@@ -0,0 +1,3 @@
+10 fa c pb c 10 . q
+:fa 0 $ 2 < fb z _ 1 r :fb 0 $ 1 - fa c * r
+:pb 0 $ 1 > 0 $ p1 z pb c pd j :p1 _ :pd 1 & 48 + . r
diff --git a/docs/history/07-zygote/code/examples/hello.s b/docs/history/07-zygote/code/examples/hello.s
new file mode 100644
index 0000000..e5baf1a
--- /dev/null
+++ b/docs/history/07-zygote/code/examples/hello.s
@@ -0,0 +1,2 @@
+s :l 0 $ @ 0 $ e z . 1 + l j :e q
+:s "hello, #32 "world! #10 #0
diff --git a/docs/history/07-zygote/code/examples/sm.s b/docs/history/07-zygote/code/examples/sm.s
new file mode 100644
index 0000000..954886e
--- /dev/null
+++ b/docs/history/07-zygote/code/examples/sm.s
@@ -0,0 +1,3 @@
+133 x ! :x 65 . 10 .
+fn c 133 fn ! fn c 131 fn ! fn c 10 . q
+:fn 65 . r