about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-02-09 16:27:16 -0800
committerKartik Agaram <vc@akkartik.com>2020-02-09 16:27:16 -0800
commitdf65053a123a3bd9dc65ddb54f3d5091ebb3a66a (patch)
tree38735a95221e707511710a9d12fc9f0aabb760da
parentb3891fbc0e0b960c33263b7d5b63320ef877a5fb (diff)
downloadmu-df65053a123a3bd9dc65ddb54f3d5091ebb3a66a.tar.gz
5996
-rw-r--r--apps/mu.subx12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/mu.subx b/apps/mu.subx
index 9855c9ea..08abf0c4 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -4377,6 +4377,7 @@ $emit-subx-stmt-list:block:
 $emit-subx-stmt-list:check-for-stmt:
         81 7/subop/compare *ecx 1/imm32/stmt1  # Stmt-tag
         0f 85/jump-if-!= break/disp32
+        # handle breaks after 'var' in a block {{{
         {
           # if !var-seen? break
           81 7/subop/compare %edx 0/imm32/false
@@ -4387,6 +4388,7 @@ $emit-subx-stmt-list:check-for-break:
           3d/compare-eax-and 0/imm32
           0f 84/jump-if-= break/disp32
           81 7/subop/compare *(ecx+8) 0/imm32  # Stmt1-inouts
+          # simple breaks without a target {{{
           {
             0f 85/jump-if-!= break/disp32
 $emit-subx-stmt-list:zero-arg-break:
@@ -4401,6 +4403,8 @@ $emit-subx-stmt-list:zero-arg-break:
             # return $emit-subx-stmt-list
             e9/jump $emit-subx-stmt-list:cleanup/disp32
           }
+          # }}}
+          # breaks with an explicit target {{{
           {
             0f 84/jump-if-= break/disp32
 $emit-subx-stmt-list:one-arg-break:
@@ -4408,7 +4412,10 @@ $emit-subx-stmt-list:one-arg-break:
             # continue
             e9/jump $emit-subx-stmt-list:continue/disp32
           }
+          # }}}
         }
+        # }}}
+        # handle loops after 'var' in a block {{{
         {
           # if !var-seen? break
           81 7/subop/compare %edx 0/imm32/false
@@ -4419,6 +4426,7 @@ $emit-subx-stmt-list:check-for-loop:
           3d/compare-eax-and 0/imm32
           0f 84/jump-if-= break/disp32
           81 7/subop/compare *(ecx+8) 0/imm32  # Stmt1-inouts
+          # simple loops without a target {{{
           {
             0f 85/jump-if-!= break/disp32
 $emit-subx-stmt-list:zero-arg-loop:
@@ -4443,6 +4451,8 @@ $emit-subx-stmt-list:zero-arg-loop:
             # continue
             e9/jump $emit-subx-stmt-list:continue/disp32
           }
+          # }}}
+          # loops with an explicit target {{{
           {
             0f 84/jump-if-= break/disp32
 $emit-subx-stmt-list:one-arg-loop:
@@ -4450,7 +4460,9 @@ $emit-subx-stmt-list:one-arg-loop:
             # continue
             e9/jump $emit-subx-stmt-list:continue/disp32
           }
+          # }}}
         }
+        # }}}
 $emit-subx-stmt-list:stmt:
         (emit-subx-statement *(ebp+8) %ecx Primitives *Program)
       }