Skip to content

Commit

Permalink
alloca(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed May 18, 2016
1 parent c65ca78 commit 6bd4307
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 28_day/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ haribote.img : haribote/ipl10.bin haribote/haribote.sys Makefile \
winhelo/winhelo.hrb winhelo2/winhelo2.hrb winhelo3/winhelo3.hrb \
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
beepdown/beepdown.hrb color/color.hrb color2/color2.hrb \
sosu/sosu.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:@: \
Expand All @@ -41,6 +42,8 @@ haribote.img : haribote/ipl10.bin haribote/haribote.sys Makefile \
copy from:beepdown/beepdown.hrb to:@: \
copy from:color/color.hrb to:@: \
copy from:color2/color2.hrb to:@: \
copy from:sosu/sosu.hrb to:@: \
copy from:sosu3/sosu3.hrb to:@: \
imgout:haribote.img

#命令
Expand Down Expand Up @@ -73,6 +76,8 @@ full :
$(MAKE) -C beepdown
$(MAKE) -C color
$(MAKE) -C color2
$(MAKE) -C sosu
$(MAKE) -C sosu3
$(MAKE) haribote.img

run_full :
Expand Down Expand Up @@ -114,6 +119,8 @@ clean_full :
$(MAKE) -C beepdown clean
$(MAKE) -C color clean
$(MAKE) -C color2 clean
$(MAKE) -C sosu clean
$(MAKE) -C sosu3 clean

src_only_full :
$(MAKE) -C haribote src_only
Expand All @@ -134,6 +141,8 @@ src_only_full :
$(MAKE) -C beepdown src_only
$(MAKE) -C color src_only
$(MAKE) -C color2 src_only
$(MAKE) -C sosu src_only
$(MAKE) -C sosu3 src_only
-$(DEL) haribote.img

refresh :
Expand Down
1 change: 1 addition & 0 deletions 28_day/sosu/!cons_9x.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
command
1 change: 1 addition & 0 deletions 28_day/sosu/!cons_nt.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmd.exe
5 changes: 5 additions & 0 deletions 28_day/sosu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP = sosu
STACK = 2k
MALLOC = 0k

include ../app_make.txt
1 change: 1 addition & 0 deletions 28_day/sosu/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
24 changes: 24 additions & 0 deletions 28_day/sosu/sosu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <stdio.h>
#include "apilib.h"

#define MAX 1000

void HariMain(void)
{
char flag[MAX], s[8];
int i, j;
for (i = 0; i < MAX; i++) {
flag[i] = 0;
}
for (i = 2; i < MAX; i++) {
if (flag[i] == 0) {
/*没有标记的为质数*/
sprintf(s, "%d ", i);
api_putstr0(s);
for (j = i * 2; j < MAX; j += i) {
flag[j] = 1; /*给它的倍数做上标记*/
}
}
}
api_end();
}
1 change: 1 addition & 0 deletions 28_day/sosu2/!cons_9x.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
command
1 change: 1 addition & 0 deletions 28_day/sosu2/!cons_nt.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmd.exe
5 changes: 5 additions & 0 deletions 28_day/sosu2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP = sosu2
STACK = 11k
MALLOC = 0k

include ../app_make.txt
1 change: 1 addition & 0 deletions 28_day/sosu2/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
24 changes: 24 additions & 0 deletions 28_day/sosu2/sosu2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <stdio.h>
#include "apilib.h"

#define MAX 10000

void HariMain(void)
{
char flag[MAX], s[8];
int i, j;
for (i = 0; i < MAX; i++) {
flag[i] = 0;
}
for (i = 2; i < MAX; i++) {
if (flag[i] == 0) {
/*没有标记的为质数*/
sprintf(s, "%d ", i);
api_putstr0(s);
for (j = i * 2; j < MAX; j += i) {
flag[j] = 1; /*给它的倍数做上标记*/
}
}
}
api_end();
}
1 change: 1 addition & 0 deletions 28_day/sosu3/!cons_9x.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
command
1 change: 1 addition & 0 deletions 28_day/sosu3/!cons_nt.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmd.exe
5 changes: 5 additions & 0 deletions 28_day/sosu3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP = sosu3
STACK = 1k
MALLOC = 42k

include ../app_make.txt
1 change: 1 addition & 0 deletions 28_day/sosu3/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
26 changes: 26 additions & 0 deletions 28_day/sosu3/sosu3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <stdio.h>
#include "apilib.h"

#define MAX 10000

void HariMain(void)
{
char *flag, s[8];
int i, j;
api_initmalloc();
flag = api_malloc(MAX);
for (i = 0; i < MAX; i++) {
flag[i] = 0;
}
for (i = 2; i < MAX; i++) {
if (flag[i] == 0) {
/*没有标记的为质数*/
sprintf(s, "%d ", i);
api_putstr0(s);
for (j = i * 2; j < MAX; j += i) {
flag[j] = 1; /*给它的倍数做上标记*/
}
}
}
api_end();
}

0 comments on commit 6bd4307

Please sign in to comment.