added doc files, test for display
[dcpu16] / tests / test_lem1802.dasm
diff --git a/tests/test_lem1802.dasm b/tests/test_lem1802.dasm
new file mode 100644 (file)
index 0000000..898808b
--- /dev/null
@@ -0,0 +1,37 @@
+; bare-bones test to locate, activate, and write to a display
+
+HWN [num]
+:loop
+    SUB [num], 1
+    HWQ [num]
+    IFE B, 0x7349
+        SET PC, found
+    SET PC, loop
+
+:found
+    ; located the first display, power it on
+    SET B, 0x8000
+    SET A, 0
+    HWI [num]
+
+    ; set border
+    SET B, 0x0003
+    SET A, 3
+    HWI [num]
+
+    ; show some text
+    SET I, string
+    SET J, 0x8000
+    ; color
+    SET Z, 0x1e00
+:print
+    BOR [i], Z
+    STI [j], [i]
+    IFN [I], 0
+        SET PC, print
+
+:wait
+    SET PC, wait
+
+:num dat 0x0000
+:string dat "yerf!", 0
\ No newline at end of file