about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--apps/mu.subx89
1 files changed, 70 insertions, 19 deletions
diff --git a/apps/mu.subx b/apps/mu.subx
index b040c20c..82c45668 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -8831,16 +8831,29 @@ Primitives:
 # - increment/decrement
 _Primitive-inc-eax:
     # var/eax <- increment => 40/increment-eax
-    "increment"/imm32/name
+    0x11/imm32/alloc-id:fake
+    _string-increment/imm32/name
+    0/imm32/no-inouts
     0/imm32/no-inouts
+    0x11/imm32/alloc-id:fake
     Single-int-var-in-eax/imm32/outputs
-    "40/increment-eax"/imm32/subx-name
+    0x11/imm32/alloc-id:fake
+    _string_increment_eax/imm32/subx-name
     0/imm32/no-rm32
     0/imm32/no-r32
     0/imm32/no-imm32
     0/imm32/no-disp32
     0/imm32/output-is-write-only
+    0x11/imm32/alloc-id:fake
     _Primitive-inc-ecx/imm32/next
+_string-increment:
+    0x11/imm32/alloc-id:fake
+    9/imm32/size
+    0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t
+_string_increment_eax:
+    0x11/imm32/alloc-id:fake
+    0x10/imm32/size
+    0x34/4 0x30/0 0x2f/slash 0x69/i 0x6e/n 0x63/c 0x72/r 0x65/e 0x6d/m 0x65/e 0x6e/n 0x74/t 0x2d/dash 0x65/e 0x61/a 0x78/x
 _Primitive-inc-ecx:
     # var/ecx <- increment => 41/increment-ecx
     "increment"/imm32/name
@@ -10147,15 +10160,22 @@ Addr-var-in-some-register:
     Any-register/imm32
 
 Single-int-var-in-eax:
+    0x11/imm32/alloc-id:fake:payload
+    0x11/imm32/alloc-id:fake
     Int-var-in-eax/imm32
     0/imm32/next
+    0/imm32/next
 
 Int-var-in-eax:
-    "arg1"/imm32/name
+    0x11/imm32/alloc-id:fake:payload
+    0/imm32/name
+    0/imm32/name
+    0x11/imm32/alloc-id:fake
     Type-int/imm32
     1/imm32/some-block-depth
     0/imm32/no-stack-offset
-    "eax"/imm32/register
+    0x11/imm32/alloc-id:fake
+    $Register-eax/imm32
 
 Single-int-var-in-ecx:
     Int-var-in-ecx/imm32
@@ -10224,9 +10244,12 @@ Lit-var:
     0/imm32/no-register
 
 Type-int:
+    0x11/imm32/alloc-id:fake:payload
     1/imm32/left-is-atom
-    1/imm32/left/int
-    0/imm32/right/null
+    1/imm32/value:int
+    0/imm32/left:unused
+    0/imm32/right:null
+    0/imm32/right:null
 
 Type-literal:
     1/imm32/left-is-atom
@@ -11643,30 +11666,58 @@ test-increment-register:
     # setup
     (clear-stream _test-output-stream)
     (clear-stream $_test-output-buffered-file->buffer)
+$test-increment-register:initialize-type:
     # var type/ecx: (handle tree type-id) = int
-    68/push 0/imm32/right/null
-    68/push 1/imm32/left/int
-    68/push 1/imm32/is-atom
+    68/push 0/imm32/right:null
+    68/push 0/imm32/right:null
+    68/push 0/imm32/left:unused
+    68/push 1/imm32/value:int
+    68/push 0x11/imm32/alloc-id:fake
+    68/push 0x11/imm32/alloc-id:fake:payload
     89/<- %ecx 4/r32/esp
-    # var var-foo/ecx: var in eax
-    68/push "eax"/imm32/register
+$test-increment-register:initialize-var:
+    # var var-foo/ecx: (handle var)
+    68/push 0/imm32/register
+    68/push 0/imm32/register
     68/push 0/imm32/no-stack-offset
     68/push 1/imm32/block-depth
     51/push-ecx
-    68/push "foo"/imm32
+    68/push 0x11/imm32/alloc-id:fake
+    68/push 0/imm32/name
+    68/push 0/imm32/name
+    68/push 0x11/imm32/alloc-id:fake:payload
     89/<- %ecx 4/r32/esp
-    # var real-outputs/edi: (handle stmt-var)
+$test-increment-register:initialize-var-name:
+    # var-foo->name = "foo"
+    8d/copy-address *(ecx+4) 0/r32/eax  # Var-name + 4
+    (copy-array Heap "foo" %eax)
+$test-increment-register:initialize-var-register:
+    # var-foo->register = "eax"
+    8d/copy-address *(ecx+0x1c) 0/r32/eax  # Var-register + 4
+    (copy-array Heap "eax" %eax)
+$test-increment-register:initialize-stmt-var:
+    # var operand/ebx: (handle stmt-var)
     68/push 0/imm32/is-deref:false
     68/push 0/imm32/next
-    51/push-ecx/var-foo
-    89/<- %edi 4/r32/esp
-    # var stmt/esi: statement
     68/push 0/imm32/next
-    57/push-edi/outputs
+    51/push-ecx/var-foo
+    68/push 0x11/imm32/alloc-id:fake
+    68/push 0x11/imm32/alloc-id:fake:payload
+    89/<- %ebx 4/r32/esp
+$test-increment-register:initialize-stmt:
+    # var stmt/esi: (addr statement)
+    53/push-ebx/outputs
+    68/push 0x11/imm32/alloc-id:fake
     68/push 0/imm32/inouts
-    68/push "increment"/imm32/operation
-    68/push 1/imm32/regular-stmt
+    68/push 0/imm32/inouts
+    68/push 0/imm32/operation
+    68/push 0/imm32/operation
+    68/push 1/imm32
     89/<- %esi 4/r32/esp
+$test-increment-register:initialize-stmt-operation:
+    # stmt->operation = "increment"
+    8d/copy-address *(esi+4) 0/r32/eax  # Stmt1-operation
+    (copy-array Heap "increment" %eax)
     # convert
     c7 0/subop/copy *Curr-block-depth 0/imm32
     (emit-subx-stmt _test-output-buffered-file %esi Primitives)