about summary refs log tree commit diff stats
path: root/apps/subx-params.subx
Commit message (Expand)AuthorAgeFilesLines
* 5765Kartik Agaram2019-11-261-0/+4
* 5675 - move helpers from subx-common into layersKartik Agaram2019-09-191-0/+15
artik.com> 2020-07-13 22:21:26 -0700 committer Kartik Agaram <vc@akkartik.com> 2020-07-13 22:21:26 -0700 6645 - heap allocations in Mu' href='/akkartik/mu/commit/308allocate-array.subx?h=hlt&id=5e0ae917d07740b9a06f3255591245acfcd9389e'>5e0ae917 ^
5462619d ^

b8df5340 ^
5e0ae917 ^




15b98801 ^
5e0ae917 ^

ae470b42 ^
15b98801 ^
5e0ae917 ^


15b98801 ^
5e0ae917 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
                                  
                                                                   
 

       
                                                                                                                




                        
               

                              
                                                
                                  


                                              
                 




                        
# 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