From 9f9aad345d9418e2fb52e45a78b8233b157be4e1 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 27 May 2020 01:41:55 -0700 Subject: 6410 --- html/apps/tui.mu.html | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 html/apps/tui.mu.html (limited to 'html/apps') diff --git a/html/apps/tui.mu.html b/html/apps/tui.mu.html new file mode 100644 index 00000000..ed8a1b39 --- /dev/null +++ b/html/apps/tui.mu.html @@ -0,0 +1,91 @@ + + + + +Mu - apps/tui.mu + + + + + + + + + + +https://github.com/akkartik/mu/blob/master/apps/tui.mu +
+ 1 # test some primitives for text-mode 
+ 2 
+ 3 fn main -> exit-status/ebx: int {
+ 4   var nrows/eax: int <- copy 0
+ 5   var ncols/ecx: int <- copy 0
+ 6   nrows, ncols <- screen-size
+ 7   enable-screen-grid-mode
+ 8   move-cursor 5, 35
+ 9   start-color 1, 0x7a
+10   start-blinking
+11   print-string "Hello world!"
+12   reset-formatting
+13   move-cursor 6, 35
+14   print-string "tty dimensions: "
+15   print-int32-to-screen nrows
+16   print-string " rows, "
+17   print-int32-to-screen ncols
+18   print-string " rows\n"
+19 
+20   print-string "press a key to see its code: "
+21   enable-keyboard-immediate-mode
+22   var x/eax: byte <- read-key
+23   enable-keyboard-type-mode
+24   enable-screen-type-mode
+25   print-string "You pressed "
+26   print-int32-to-screen x
+27   print-string "\n"
+28   exit-status <- copy 0
+29 }
+
+ + + -- cgit 1.4.1-2-gfad0