aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-04-14 03:35:46 +0200
committerkdx <kikoodx@paranoici.org>2023-04-14 03:35:46 +0200
commitcccfd1feffba5cab4510ed1d0597a9a7961854ef (patch)
tree71072737806a72bac6767001ee3e548bce3bafda /samples
parentd77814424e5e3fe1b01cc4d2250d97248a70e2a9 (diff)
downloadorga-cccfd1feffba5cab4510ed1d0597a9a7961854ef.tar.gz
receive input
Diffstat (limited to 'samples')
-rw-r--r--samples/helloworld.orgaasm18
-rw-r--r--samples/input.orgaasm4
-rw-r--r--samples/minimal.orgaasm26
-rw-r--r--samples/shfthelloworld.orgaasm24
4 files changed, 38 insertions, 34 deletions
diff --git a/samples/helloworld.orgaasm b/samples/helloworld.orgaasm
index b78de23..abc99bc 100644
--- a/samples/helloworld.orgaasm
+++ b/samples/helloworld.orgaasm
@@ -1,14 +1,14 @@
-LIT ,hellostr
-JRT ,putstr
-RET
+ LIT ,hellostr
+ JRT ,putstr
+ RET
@putstr ( str -- )
- DUP LDA WRT ( write )
- INC ( increment pointer )
- DUP LDA ( loop until end of string )
- JNZ ,putstr
- POP
-RET
+ DUP LDA WRT ( write )
+ INC ( increment pointer )
+ DUP LDA ( loop until end of string )
+ JNZ ,putstr
+ POP
+ RET
( "hello world" )
@hellostr 0068 0065 006c 006c 006f 0020 0077 006f 0072 006c 0064 000a 0000
diff --git a/samples/input.orgaasm b/samples/input.orgaasm
new file mode 100644
index 0000000..a5da548
--- /dev/null
+++ b/samples/input.orgaasm
@@ -0,0 +1,4 @@
+@loop
+ SLP
+ LIT ,Input LDA DBG POP
+ JMP ,loop
diff --git a/samples/minimal.orgaasm b/samples/minimal.orgaasm
index 5ae1d7b..c9196ee 100644
--- a/samples/minimal.orgaasm
+++ b/samples/minimal.orgaasm
@@ -1,13 +1,13 @@
-LIT 0068 WRT ( h )
-LIT 0065 WRT ( e )
-LIT 006c WRT ( l )
-LIT 006c WRT ( l )
-LIT 006f WRT ( o )
-LIT 0020 WRT ( )
-LIT 0077 WRT ( w )
-LIT 006f WRT ( o )
-LIT 0072 WRT ( r )
-LIT 006c WRT ( l )
-LIT 0064 WRT ( d )
-LIT 000a WRT ( \n )
-RET
+ LIT 0068 WRT ( h )
+ LIT 0065 WRT ( e )
+ LIT 006c WRT ( l )
+ LIT 006c WRT ( l )
+ LIT 006f WRT ( o )
+ LIT 0020 WRT ( )
+ LIT 0077 WRT ( w )
+ LIT 006f WRT ( o )
+ LIT 0072 WRT ( r )
+ LIT 006c WRT ( l )
+ LIT 0064 WRT ( d )
+ LIT 000a WRT ( \n )
+ RET
diff --git a/samples/shfthelloworld.orgaasm b/samples/shfthelloworld.orgaasm
index 896b165..da77f20 100644
--- a/samples/shfthelloworld.orgaasm
+++ b/samples/shfthelloworld.orgaasm
@@ -1,17 +1,17 @@
-LIT ,hellostr
-JRT ,putstr
-RET
+ LIT ,hellostr
+ JRT ,putstr
+ RET
@putstr ( str -- )
- DUP LDA ( read memory )
- DUP #00ff AND ( split the short in two )
- SWP #0008 RSF
- WRT WRT ( write )
- INC ( increment pointer )
- DUP LDA ( loop until end of string )
- JNZ ,putstr
- POP
-RET
+ DUP LDA ( read memory )
+ DUP #00ff AND ( split the short in two )
+ SWP #0008 RSF
+ WRT WRT ( write )
+ INC ( increment pointer )
+ DUP LDA ( loop until end of string )
+ JNZ ,putstr
+ POP
+ kRET
( "hello world" )
@hellostr 6865 6c6c 6f20 776f 726c 640a 0000