mirror of https://github.com/aamine/cbc
* lib/alloca.s: alloca() implemeted.
* lib/Makefile: build it. * import/alloca.hb: declare alloca. git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4103 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
parent
b598628af9
commit
76fd64dc52
|
|
@ -1,3 +1,11 @@
|
||||||
|
Mon Dec 8 00:55:33 2008 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* lib/alloca.s: alloca() implemeted.
|
||||||
|
|
||||||
|
* lib/Makefile: build it.
|
||||||
|
|
||||||
|
* import/alloca.hb: declare alloca.
|
||||||
|
|
||||||
Sun Dec 7 23:26:50 2008 Minero Aoki <aamine@loveruby.net>
|
Sun Dec 7 23:26:50 2008 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* net: revert r4100; implementing alloca() is too difficult for
|
* net: revert r4100; implementing alloca() is too difficult for
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import stddef;
|
||||||
|
|
||||||
|
extern void* alloca(size_t len);
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
CBC = ../bin/cbc
|
CBC = ../bin/cbc
|
||||||
CBFLAGS = -O -fPIC
|
CBFLAGS = -O -fPIC
|
||||||
TARGET = libcbc.a
|
TARGET = libcbc.a
|
||||||
OBJS = stdarg.o
|
OBJS = stdarg.o alloca.o
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .cb .s .o
|
.SUFFIXES: .cb .s .o
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
.text
|
||||||
|
.globl alloca
|
||||||
|
.type alloca,@function
|
||||||
|
alloca:
|
||||||
|
addl $4, %esp
|
||||||
|
movl -4(%esp), %ecx
|
||||||
|
movl (%esp), %eax
|
||||||
|
addl $3, %eax
|
||||||
|
andl $-4, %eax
|
||||||
|
subl %eax, %esp
|
||||||
|
movl %esp, %eax
|
||||||
|
addl $4, %eax
|
||||||
|
jmp *%ecx
|
||||||
|
.size alloca, .-alloca
|
||||||
Loading…
Reference in New Issue