about summary refs log tree commit diff stats
path: root/baremetal
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-13 19:50:30 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-13 19:50:30 -0800
commitf8cb5f97c6d89c2a71b0587056b49bc4642f21d4 (patch)
tree20ebc2829f961fa2f19e7b3aac2d5c89d8051b50 /baremetal
parentf36093ecd927005ee00312defab205218b30e0d0 (diff)
downloadmu-f8cb5f97c6d89c2a71b0587056b49bc4642f21d4.tar.gz
7513
Diffstat (limited to 'baremetal')
-rw-r--r--baremetal/ex7.mu58
1 files changed, 28 insertions, 30 deletions
diff --git a/baremetal/ex7.mu b/baremetal/ex7.mu
index 6beac7aa..50174385 100644
--- a/baremetal/ex7.mu
+++ b/baremetal/ex7.mu
@@ -11,36 +11,34 @@
 # k, l.
 
 fn main {
+  var key/eax: byte <- read-key 0
   {
-    var key/eax: byte <- read-key 0
-    {
-      compare key, 0x68  # 'h'
-      break-if-!=
-      var g/eax: grapheme <- copy 0x2d  # '-'
-      draw-grapheme-at-cursor 0, g, 0x31
-      cursor-left 0
-    }
-    {
-      compare key, 0x6a  # 'j'
-      break-if-!=
-      var g/eax: grapheme <- copy 0x7c  # '|'
-      draw-grapheme-at-cursor 0, g, 0x31
-      cursor-down 0
-    }
-    {
-      compare key, 0x6b  # 'k'
-      break-if-!=
-      var g/eax: grapheme <- copy 0x7c  # '|'
-      draw-grapheme-at-cursor 0, g, 0x31
-      cursor-up 0
-    }
-    {
-      compare key, 0x6c  # 'l'
-      break-if-!=
-      var g/eax: grapheme <- copy 0x2d  # '-'
-      draw-grapheme-at-cursor 0, g, 0x31
-      cursor-right 0
-    }
-    loop
+    compare key, 0x68  # 'h'
+    break-if-!=
+    var g/eax: grapheme <- copy 0x2d  # '-'
+    draw-grapheme-at-cursor 0, g, 0x31
+    cursor-left 0
   }
+  {
+    compare key, 0x6a  # 'j'
+    break-if-!=
+    var g/eax: grapheme <- copy 0x7c  # '|'
+    draw-grapheme-at-cursor 0, g, 0x31
+    cursor-down 0
+  }
+  {
+    compare key, 0x6b  # 'k'
+    break-if-!=
+    var g/eax: grapheme <- copy 0x7c  # '|'
+    draw-grapheme-at-cursor 0, g, 0x31
+    cursor-up 0
+  }
+  {
+    compare key, 0x6c  # 'l'
+    break-if-!=
+    var g/eax: grapheme <- copy 0x2d  # '-'
+    draw-grapheme-at-cursor 0, g, 0x31
+    cursor-right 0
+  }
+  loop
 }