From bcf02529b8b0438f36aab4a7893e8be1d602a5e1 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 3 May 2020 16:12:14 -0700 Subject: mu.subx: more progress on parse-mu-block --- apps/mu.subx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'apps/mu.subx') diff --git a/apps/mu.subx b/apps/mu.subx index 38c5fcd0..4cf22917 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -4765,7 +4765,6 @@ $parse-mu-block:line-loop: # if (line->write == 0) break 81 7/subop/compare *ecx 0/imm32 0f 84/jump-if-= break/disp32 - # HERE # word-slice = next-mu-token(line) (next-mu-token %ecx %edx) #? (write-buffered Stderr "word: ") @@ -4792,8 +4791,16 @@ $parse-mu-block:check-for-block: 74/jump-if-= break/disp8 (check-no-tokens-left %ecx) # parse new block and append - (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10)) # => eax - (append-to-block Heap %edi %eax) + # . var tmp/eax: (handle block) + 68/push 0/imm32 + 68/push 0/imm32 + 89/<- %eax 4/r32/esp + # . + (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10) %eax) + (append-to-block Heap %edi *eax *(eax+4)) + # . reclaim tmp + 81 0/subop/add %esp 8/imm32 + # . e9/jump $parse-mu-block:line-loop/disp32 } # if slice-equal?(word-slice, "}") break @@ -4817,6 +4824,7 @@ $parse-mu-block:check-for-named-block: # skip ':' ff 1/subop/decrement *(edx+4) # Slice-end # + # HERE (parse-mu-named-block %edx *(ebp+8) *(ebp+0xc) *(ebp+0x10)) # => eax (append-to-block Heap %edi %eax) e9/jump $parse-mu-block:line-loop/disp32 @@ -5977,7 +5985,7 @@ append-to-block: # ad: (addr allocation-descriptor), block: (addr block), x: (h # esi = block 8b/-> *(ebp+0xc) 6/r32/esi # block->stmts = append(x, block->stmts) - 8d/copy-address *(esi+4) 0/r32/eax + 8d/copy-address *(esi+4) 0/r32/eax # Block-stmts (append-list *(ebp+8) *(ebp+0x10) *(ebp+0x14) *(esi+4) *(esi+8) %eax) # ad, x, x, Block-stmts, Block-stmts $append-to-block:end: # . restore registers -- cgit 1.4.1-2-gfad0