about summary refs log tree commit diff stats
path: root/baremetal/101screen.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-12-29 21:16:28 -0800
committerKartik Agaram <vc@akkartik.com>2020-12-29 21:17:03 -0800
commit520e3c25427f48bd68ded41a5678ca43c28a9891 (patch)
tree3d8cfde1f031e4f4c856bb42ac3c370a1a08d55d /baremetal/101screen.subx
parent0daf12c59aa8a6b9d996f56797b6f74c3aa0a738 (diff)
downloadmu-520e3c25427f48bd68ded41a5678ca43c28a9891.tar.gz
7470
The ol' 8-byte-register-names issue strikes again. There's no way to access
the lower 8 bits of ESI.

There's still a bug in baremetal/ex2.mu; it's printing transposed somehow.
Diffstat (limited to 'baremetal/101screen.subx')
-rw-r--r--baremetal/101screen.subx14
1 files changed, 7 insertions, 7 deletions
diff --git a/baremetal/101screen.subx b/baremetal/101screen.subx
index 3e98d96b..fb87709c 100644
--- a/baremetal/101screen.subx
+++ b/baremetal/101screen.subx
@@ -6,10 +6,10 @@ pixel:  # screen: (addr screen), x: int, y: int, color: int
     89/<- %ebp 4/r32/esp
     # . save registers
     50/push-eax
-    56/push-esi
-    # esi = screen
-    8b/-> *(ebp+8) 6/r32/esi
-    81 7/subop/compare %esi 0/imm32
+    51/push-ecx
+    # ecx = screen
+    8b/-> *(ebp+8) 1/r32/ecx
+    81 7/subop/compare %ecx 0/imm32
     {
       75/jump-if-!= break/disp8
       # bounds checks
@@ -30,15 +30,15 @@ pixel:  # screen: (addr screen), x: int, y: int, color: int
       # eax += location of frame buffer
       03/add-> *0x7f28 0/r32/eax
       # *eax = color
-      8b/-> *(ebp+0x14) 6/r32/esi
-      88/byte<- *eax 6/r32/esi
+      8b/-> *(ebp+0x14) 1/r32/ecx
+      88/byte<- *eax 1/r32/CL
       # return
       eb $pixel:end/disp8
     }
     # TODO: fake screen
 $pixel:end:
     # . restore registers
-    5e/pop-to-esi
+    59/pop-to-ecx
     58/pop-to-eax
     # . epilogue
     89/<- %esp 5/r32/ebp