summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-07-25 05:56:08 +0200
committerLouis Burda <quent.burda@gmail.com>2023-07-25 05:56:08 +0200
commit7d73b738a5703d5263a84dcbe3564e2267af6804 (patch)
treee386ecb7813d86577b9fc5ef5153785de60d6f51 /test
parent41760436d528552d64122bb0c837f4d8274a0bdd (diff)
downloadtis100-7d73b738a5703d5263a84dcbe3564e2267af6804.tar.gz
tis100-7d73b738a5703d5263a84dcbe3564e2267af6804.zip
Improve parsing, make stdin / stdout port optional
Diffstat (limited to 'test')
-rw-r--r--test/and.asm27
-rw-r--r--test/xor.asm26
2 files changed, 53 insertions, 0 deletions
diff --git a/test/and.asm b/test/and.asm
new file mode 100644
index 0000000..c4a15a6
--- /dev/null
+++ b/test/and.asm
@@ -0,0 +1,27 @@
+stdout X1 Y1
+
+tpu X1 Y0
+ mov 0, DOWN
+ mov 1, DOWN
+ mov 0, DOWN
+ mov 1, DOWN
+ MOV UP, NIL
+end
+
+tpu X0 Y1
+ mov 0, RIGHT
+ mov 0, RIGHT
+ mov 1, RIGHT
+ mov 1, RIGHT
+ MOV UP, NIL
+end
+
+tpu X1 Y1
+ mov 2, ACC
+ sub UP
+ sub LEFT
+ jez H
+ mov 0, DOWN
+ jro 2
+H: mov 1, DOWN
+end
diff --git a/test/xor.asm b/test/xor.asm
new file mode 100644
index 0000000..7e24812
--- /dev/null
+++ b/test/xor.asm
@@ -0,0 +1,26 @@
+stdout X1 Y1
+
+tpu X1 Y0
+ mov 0, DOWN
+ mov 1, DOWN
+ mov 0, DOWN
+ mov 1, DOWN
+ MOV UP, NIL
+end
+
+tpu X0 Y1
+ mov 0, RIGHT
+ mov 0, RIGHT
+ mov 1, RIGHT
+ mov 1, RIGHT
+ MOV UP, NIL
+end
+
+tpu X1 Y1
+ MOV UP, ACC
+ sub LEFT
+ jnz H
+ mov 0, DOWN
+ jro 2
+H: mov 1, DOWN
+end