alloca(2)

This commit is contained in:
Yourtion
2016-05-18 11:02:51 +08:00
parent 1bcf500c14
commit 7b5d69c7c8
7 changed files with 26 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ haribote.img : haribote/ipl10.bin haribote/haribote.sys Makefile \
star1/star1.hrb stars/stars.hrb stars2/stars2.hrb \
lines/lines.hrb walk/walk.hrb noodle/noodle.hrb \
beepdown/beepdown.hrb color/color.hrb color2/color2.hrb \
sosu/sosu.hrb sosu3/sosu3.hrb
sosu/sosu.hrb sosu2/sosu2.hrb sosu3/sosu3.hrb
$(EDIMG) imgin:../z_tools/fdimg0at.tek \
wbinimg src:haribote/ipl10.bin len:512 from:0 to:0 \
copy from:haribote/haribote.sys to:@: \
@@ -43,6 +43,7 @@ haribote.img : haribote/ipl10.bin haribote/haribote.sys Makefile \
copy from:color/color.hrb to:@: \
copy from:color2/color2.hrb to:@: \
copy from:sosu/sosu.hrb to:@: \
copy from:sosu2/sosu2.hrb to:@: \
copy from:sosu3/sosu3.hrb to:@: \
imgout:haribote.img
@@ -77,6 +78,7 @@ full :
$(MAKE) -C color
$(MAKE) -C color2
$(MAKE) -C sosu
$(MAKE) -C sosu2
$(MAKE) -C sosu3
$(MAKE) haribote.img
@@ -120,6 +122,7 @@ clean_full :
$(MAKE) -C color clean
$(MAKE) -C color2 clean
$(MAKE) -C sosu clean
$(MAKE) -C sosu2 clean
$(MAKE) -C sosu3 clean
src_only_full :
@@ -142,6 +145,7 @@ src_only_full :
$(MAKE) -C color src_only
$(MAKE) -C color2 src_only
$(MAKE) -C sosu src_only
$(MAKE) -C sosu2 src_only
$(MAKE) -C sosu3 src_only
-$(DEL) haribote.img

View File

@@ -1,7 +1,8 @@
OBJS_API = api001.obj api002.obj api003.obj api004.obj api005.obj api006.obj \
api007.obj api008.obj api009.obj api010.obj api011.obj api012.obj \
api013.obj api014.obj api015.obj api016.obj api017.obj api018.obj \
api019.obj api020.obj
api019.obj api020.obj \
alloca.obj
TOOLPATH = ../../z_tools/
INCPATH = ../../z_tools/haribote/

13
28_day/apilib/alloca.nas Normal file
View File

@@ -0,0 +1,13 @@
[FORMAT "WCOFF"]
[INSTRSET "i486p"]
[BITS 32]
[FILE "alloca.nas"]
GLOBAL __alloca
[SECTION .text]
__alloca:
ADD EAX,-4
SUB ESP,EAX
JMP DWORD [ESP+EAX] ; 代替RET

View File

@@ -1,5 +1,5 @@
APP = winhelo
STACK = 1k
STACK = 8k
MALLOC = 0k
include ../app_make.txt

View File

@@ -1,10 +1,10 @@
#include "apilib.h"
char buf[150 * 50];
void HariMain(void)
{
int win;
char buf[150 * 50];
win = api_openwin(buf, 150, 50, -1, "hello");
for (;;) {
if (api_getkey(1) == 0x0a) {

View File

@@ -1,5 +1,5 @@
APP = winhelo2
STACK = 1k
STACK = 8k
MALLOC = 0k
include ../app_make.txt

View File

@@ -1,10 +1,10 @@
#include "apilib.h"
char buf[150 * 50];
void HariMain(void)
{
int win;
char buf[150 * 50];
win = api_openwin(buf, 150, 50, -1, "hello");
api_boxfilwin(win, 8, 36, 141, 43, 3); /*黄色*/
api_putstrwin(win, 28, 28, 0 /*黑色*/, 12, "hello, world");