From 39eb1e4963731816e28ffa910098e2de622d8de0 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 11 Mar 2020 17:34:48 -0700 Subject: 6125 --- apps/mu | Bin 187294 -> 187308 bytes apps/mu.subx | 21 +++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'apps') diff --git a/apps/mu b/apps/mu index 86f19f7a..53ad29ff 100755 Binary files a/apps/mu and b/apps/mu differ diff --git a/apps/mu.subx b/apps/mu.subx index 34e5419c..138ff94e 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -5937,14 +5937,23 @@ compute-size-of-var: # in: (handle var) -> result/eax: int # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp - # eax: (handle var) = in - 8b/-> *(ebp+8) 0/r32/eax - # eax: type-id = in->type - 8b/-> *(eax+4) 0/r32/eax # Var-type - # TODO: support non-atom type + # . push registers + 51/push-ecx + # var t/ecx: (handle tree type-id) = v->type + 8b/-> *(ebp+8) 1/r32/ecx + 8b/-> *(ecx+4) 1/r32/ecx # Var-type + # if (t->left >= *Max-type-id) t = t->left + { + 8b/-> *Max-type-id 0/r32/eax + 39/compare *ecx 0/r32/eax # Tree-left + 72/jump-if-addr< break/disp8 + 8b/-> *ecx 1/r32/ecx # Tree-left + } # TODO: support arrays - (compute-size-of-type-id *eax) # Atom-left => eax + (compute-size-of-type-id *ecx) # Atom-left => eax $compute-size-of-var:end: + # . restore registers + 59/pop-to-ecx # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp -- cgit 1.4.1-2-gfad0