tinycc/lib/alloca86.S

37 lines
661 B
ArmAsm
Raw Normal View History

2007-11-23 08:03:03 +08:00
/* ---------------------------------------------- */
/* alloca86.S */
#ifdef __leading_underscore
# define _(s) _##s
#else
# define _(s) s
#endif
2007-11-23 08:03:03 +08:00
.globl _(alloca), _(__alloca)
_(alloca):
_(__alloca):
push %ebp
mov %esp,%ebp
mov 8(%ebp),%eax
2007-11-23 08:03:03 +08:00
add $3,%eax
and $-4,%eax
#ifdef _WIN32
jmp .+16 #p2
2007-11-23 08:03:03 +08:00
p1:
sub $4096,%esp
sub $4096,%eax
test %eax,(%esp)
2007-11-23 08:03:03 +08:00
p2:
cmp $4096,%eax
jae p1
#endif
2007-11-23 08:03:03 +08:00
sub %eax,%esp
mov 4(%ebp),%eax
mov 0(%ebp),%ebp
add $8,%esp
push %eax
lea 8(%esp),%eax
2007-11-23 08:03:03 +08:00
ret
/* ---------------------------------------------- */