about summary refs log tree commit diff stats
path: root/308allocate-array.subx
blob: 5cc0fe1bdf1c7b4135f4424a4b2b11066e31e9f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left
# 2-arg version of allocate-array.
# Really only intended to be called from code generated by mu.subx.

== 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-edx-eax *(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
n class="w"> state); void test_muc_room_is_not_active(void** state); void test_muc_active(void** state);