mu/308allocate-array.subx
Kartik Agaram 5462619d96 6742 - support for formatting in fake screens
We still need a few primitives, but we can implement these as needed. I'm
ready to call the fake screen done.
2020-09-07 14:18:48 -07:00

25 lines
597 B
Plaintext

# 2-arg version of allocate-array.
== code
allocate-array2: # ad: (addr allocation-descriptor), array-len: int, elem-size: int, out: (addr handle array _)
# . prologue
55/push-ebp
89/<- %ebp 4/r32/esp
# . save registers
50/push-eax
52/push-edx
#
8b/-> *(ebp+0xc) 0/r32/eax
f7 4/subop/multiply-into-eax-edx *(ebp+0x10)
# TODO: check edx for overflow
(allocate-array *(ebp+8) %eax *(ebp+0x14))
$allocate-array2:end:
# . restore registers
5a/pop-to-edx
58/pop-to-eax
# . epilogue
89/<- %esp 5/r32/ebp
5d/pop-to-ebp
c3/return