about summary refs log tree commit diff stats
path: root/apps/screen.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-27 00:09:22 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-27 00:09:22 -0700
commit9511ff5cd7aeef4ccf501920e6969d2b15ecf2d5 (patch)
tree505399362eaf6d0297b6788bf1b86799eed23728 /apps/screen.mu
parent985f7f79bee5481cc1247d1d68b1b2d47f5b500c (diff)
downloadmu-9511ff5cd7aeef4ccf501920e6969d2b15ecf2d5.tar.gz
6409 - primitives for text-mode UIs
Diffstat (limited to 'apps/screen.mu')
-rw-r--r--apps/screen.mu20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/screen.mu b/apps/screen.mu
new file mode 100644
index 00000000..4f36809e
--- /dev/null
+++ b/apps/screen.mu
@@ -0,0 +1,20 @@
+# test some primitives for text-mode 
+
+fn main -> exit-status/ebx: int {
+  var nrows/eax: int <- copy 0
+  var ncols/ecx: int <- copy 0
+  nrows, ncols <- screen-size
+  enable-screen-grid-mode
+  move-cursor 5, 35
+  start-color 1, 0x7a
+  start-blinking
+  print-string "Hello world!"
+  reset-formatting
+  move-cursor 6, 35
+  print-string "tty dimensions: "
+  print-int32-to-screen nrows
+  print-string " rows, "
+  print-int32-to-screen ncols
+  print-string " rows\n"
+  exit-status <- copy 0
+}