6521 - new primitive: array size in bytes

This commit is contained in:
Kartik Agaram 2020-06-14 00:40:16 -07:00
parent ad61776f49
commit 5945986cc5
2 changed files with 17 additions and 0 deletions

17
106size.subx Normal file
View File

@ -0,0 +1,17 @@
# Size of an array in bytes.
== code
size: # in: (addr array _) -> result/eax: int
# . prologue
55/push-ebp
89/<- %ebp 4/r32/esp
# eax = in
8b/-> *(ebp+8) 0/r32/eax
#
8b/-> *eax 0/r32/eax
$size:end:
# . epilogue
89/<- %esp 5/r32/ebp
5d/pop-to-ebp
c3/return

BIN
apps/mu

Binary file not shown.