about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-08-29 00:16:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-08-29 00:16:51 -0700
commita46cb565ca99174876cbfb637640494dedf8eec1 (patch)
tree616fd1b80e743362f1594733c5169641bd4a94f2
parent96f91f9b2d39609749d4f53b822ccc3f043fcb7b (diff)
downloadmu-a46cb565ca99174876cbfb637640494dedf8eec1.tar.gz
.
-rw-r--r--103grapheme.subx15
1 files changed, 7 insertions, 8 deletions
diff --git a/103grapheme.subx b/103grapheme.subx
index ab0e7b5c..417914d4 100644
--- a/103grapheme.subx
+++ b/103grapheme.subx
@@ -139,18 +139,19 @@ draw-narrow-grapheme-on-screen-buffer:  # buffer: (addr byte), letter-bitmap: (a
     52/push-edx
     53/push-ebx
     56/push-esi
+    57/push-edi
     # esi = letter-bitmap
     8b/-> *(ebp+0xc) 6/r32/esi
     # var ycurr/edx: int = y*16
     8b/-> *(ebp+0x14) 2/r32/edx
     c1 4/subop/shift-left %edx 4/imm8
-    # var ymax/ebx: int = ycurr + 16
-    8b/-> *(ebp+0x14) 3/r32/ebx
-    c1 4/subop/shift-left %ebx 4/imm8
-    81 0/subop/add %ebx 0x10/imm32
+    # var ymax/edi: int = ycurr + 16
+    8b/-> *(ebp+0x14) 7/r32/edi
+    c1 4/subop/shift-left %edi 4/imm8
+    81 0/subop/add %edi 0x10/imm32
     {
       # if (ycurr >= ymax) break
-      39/compare %edx 3/r32/ebx
+      39/compare %edx 7/r32/edi
       0f 8d/jump-if->= break/disp32
       # var xcurr/eax: int = x*8 + 7
       8b/-> *(ebp+0x10) 0/r32/eax
@@ -160,7 +161,6 @@ draw-narrow-grapheme-on-screen-buffer:  # buffer: (addr byte), letter-bitmap: (a
       8b/-> *(ebp+0x10) 1/r32/ecx
       c1 4/subop/shift-left %ecx 3/imm8
       # var row-bitmap/ebx: int = *letter-bitmap
-      53/push-ebx
       bb/copy-to-ebx 0/imm32
       8a/byte-> *esi 3/r32/BL
       {
@@ -183,8 +183,6 @@ $draw-grapheme-on-screen-buffer:continue:
         #
         eb/jump loop/disp8
       }
-      # reclaim row-bitmap
-      5b/pop-to-ebx
       # ++y
       42/increment-edx
       # next bitmap row
@@ -194,6 +192,7 @@ $draw-grapheme-on-screen-buffer:continue:
     }
 $draw-narrow-grapheme-on-screen-buffer:end:
     # . restore registers
+    5f/pop-to-edi
     5e/pop-to-esi
     5b/pop-to-ebx
     5a/pop-to-edx