about summary refs log tree commit diff stats
path: root/baremetal
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-09 13:43:39 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-09 13:43:39 -0800
commit26697e649b9fab6fe714d16a0d2df487d154c189 (patch)
treef4c46c622558ef988b8dd5ddb4e5759aa223f37e /baremetal
parentbe87d723358c5889541fd145f76398bc4447584b (diff)
downloadmu-26697e649b9fab6fe714d16a0d2df487d154c189.tar.gz
7487
Diffstat (limited to 'baremetal')
-rw-r--r--baremetal/ex2.subx39
1 files changed, 18 insertions, 21 deletions
diff --git a/baremetal/ex2.subx b/baremetal/ex2.subx
index 5f007327..591c1e22 100644
--- a/baremetal/ex2.subx
+++ b/baremetal/ex2.subx
@@ -10,27 +10,24 @@
 # Expected output:
 #   html/baremetal.png
 
-# main:  (address 0x8800)
+main:  # (address 0x8800)
+  # ecx <- start of video memory
+  8b/-> *0x7f28 1/r32/ecx
 
-== code
+  # eax <- final pixel of video memory
+  8d/copy-address *(ecx + 0x0bffff) 0/r32/eax  # 0xbffff = 1024*768 - 1
 
-# ecx <- start of video memory
-8b/-> *0x7f28 1/r32/ecx
+  # for each pixel in video memory
+  {
+    39/compare %eax 1/r32/ecx
+    7c/jump-if-< break/disp8
+    # write its column number to it
+    88/byte<- *eax 0/r32/AL
+    48/decrement-eax
+    eb/jump loop/disp8
+  }
 
-# eax <- final pixel of video memory
-8d/copy-address *(ecx + 0x0bffff) 0/r32/eax  # 0xbffff = 1024*768 - 1
-
-# for each pixel in video memory
-{
-  39/compare %eax 1/r32/ecx
-  7c/jump-if-< break/disp8
-  # write its column number to it
-  88/byte<- *eax 0/r32/AL
-  48/decrement-eax
-  eb/jump loop/disp8
-}
-
-# hang indefinitely
-{
-  eb/jump loop/disp8
-}
+  # hang indefinitely
+  {
+    eb/jump loop/disp8
+  }