From f2d6bb1cb8dc95bfd2e268c94e3aec3855b7c81b Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 11 Mar 2020 17:25:41 -0700 Subject: 6124 --- apps/mu | Bin 187282 -> 187294 bytes apps/mu.subx | 10 ++++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/mu b/apps/mu index 883a9bea..86f19f7a 100755 Binary files a/apps/mu and b/apps/mu differ diff --git a/apps/mu.subx b/apps/mu.subx index 8ac7ba77..34e5419c 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -6109,10 +6109,16 @@ size-of: # v: (handle var) -> result/eax: int 89/<- %ebp 4/r32/esp # . save registers 51/push-ecx - # ecx = v->type + # var t/ecx: (handle tree type-id) = v->type 8b/-> *(ebp+8) 1/r32/ecx 8b/-> *(ecx+4) 1/r32/ecx # Var-type - # TODO: support non-atom 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 (size-of-type-id *ecx) # Atom-left => eax $size-of:end: -- cgit 1.4.1-2-gfad0