59 |
data |
data |
60 |
text |
text |
61 |
globl _alloca |
globl _alloca |
62 |
_alloca |
_alloca |
63 |
move.l (sp)+,a0 ; pop return addr from top of stack |
move.l (sp)+,a0 ; pop return addr from top of stack |
64 |
move.l (sp)+,d0 ; pop size in bytes from top of stack |
move.l (sp)+,d0 ; pop size in bytes from top of stack |
65 |
add.l #ROUND,d0 ; round size up to long word |
add.l #ROUND,d0 ; round size up to long word |
112 |
alloca: |
alloca: |
113 |
#ifdef MOTOROLA_DELTA |
#ifdef MOTOROLA_DELTA |
114 |
/* slightly modified version of alloca to motorola sysV/68 pcc - based |
/* slightly modified version of alloca to motorola sysV/68 pcc - based |
115 |
compiler. |
compiler. |
116 |
this compiler saves used registers relative to %sp instead of %fp. |
this compiler saves used registers relative to %sp instead of %fp. |
117 |
alright, just make new copy of saved register set whenever we allocate |
alright, just make new copy of saved register set whenever we allocate |
118 |
new space from stack.. |
new space from stack.. |
251 |
* We have to copy registers, and therefore waste 32 bytes. |
* We have to copy registers, and therefore waste 32 bytes. |
252 |
* |
* |
253 |
* Stack layout: |
* Stack layout: |
254 |
* new sp -> junk |
* new sp -> junk |
255 |
* registers (copy) |
* registers (copy) |
256 |
* r0 -> new data |
* r0 -> new data |
257 |
* | (orig retval) |
* | (orig retval) |
258 |
* | (orig arg) |
* | (orig arg) |
259 |
* old sp -> regs (orig) |
* old sp -> regs (orig) |