From f8cb5f97c6d89c2a71b0587056b49bc4642f21d4 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 13 Jan 2021 19:50:30 -0800 Subject: 7513 --- baremetal/ex7.mu | 58 +++++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'baremetal/ex7.mu') 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 } -- cgit 1.4.1-2-gfad0