about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-07-09 07:57:03 -0700
committerKartik Agaram <vc@akkartik.com>2020-07-09 07:57:03 -0700
commita3bfbb99f8076da0b0880cfcdde94b526c2d6f0a (patch)
treef47a071f8d61b5b59d1989371cd622498b7fc59c
parent88aeadf3c69c228e8646142f9a08457211f92c16 (diff)
downloadmu-a3bfbb99f8076da0b0880cfcdde94b526c2d6f0a.tar.gz
6624
-rw-r--r--304screen.subx1
-rw-r--r--apps/mu.subx22
2 files changed, 11 insertions, 12 deletions
diff --git a/304screen.subx b/304screen.subx
index 116d0320..208c02dd 100644
--- a/304screen.subx
+++ b/304screen.subx
@@ -119,6 +119,7 @@ $move-cursor-on-screen:end:
     5d/pop-to-ebp
     c3/return
 
+# just because Mu has no support for global variables yet
 print-string-to-screen:  # s: (addr array byte)
     # . prologue
     55/push-ebp
diff --git a/apps/mu.subx b/apps/mu.subx
index 627a9436..263a0cee 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -10596,7 +10596,7 @@ check-mu-stmt:  # stmt: (addr stmt), fn: (addr function), err: (addr buffered-fi
     89/<- %ebp 4/r32/esp
     # . save registers
     50/push-eax
-    # if stmt's operation matches a primitive, check against it
+    # - if stmt's operation matches a primitive, check against it
     (has-primitive-name? *(ebp+8))  # => eax
     3d/compare-eax-and 0/imm32/false
     {
@@ -10604,19 +10604,17 @@ check-mu-stmt:  # stmt: (addr stmt), fn: (addr function), err: (addr buffered-fi
       (check-mu-primitive *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14))
       eb/jump $check-mu-stmt:end/disp8
     }
-    # otherwise find a function to check against
+    # - otherwise find a function to check against
+    # var f/edi: (addr function) = lookup(*Program->functions)
+    (lookup *_Program-functions *_Program-functions->payload)  # => eax
+    (find-matching-function %eax *(ebp+8))  # => eax
+    3d/compare-eax-and 0/imm32
     {
-      # var f/edi: (addr function) = lookup(*Program->functions)
-      (lookup *_Program-functions *_Program-functions->payload)  # => eax
-      (find-matching-function %eax *(ebp+8))  # => eax
-      3d/compare-eax-and 0/imm32
-      {
-        74/jump-if-= break/disp8
-        (check-mu-call *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14))
-        eb/jump $check-mu-stmt:end/disp8
-      }
-      # TODO: error on unknown function. We need to first type-check calls to SubX functions.
+      74/jump-if-= break/disp8
+      (check-mu-call *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14))
+      eb/jump $check-mu-stmt:end/disp8
     }
+    # TODO: error on unknown function. We need to first type-check calls to SubX functions.
 $check-mu-stmt:end:
     # . restore registers
     58/pop-to-eax