16FLAGS=-fh=16.hed
BAKAPIFLAGS=-fh=bakapi.hed
-SEGAFLAGS=-0 -d2 -lr $(OFLAGS)
SFLAGS=-k32768#51200#49152
DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS)
ZFLAGS=-zk0 -zq# -zu -zm# -zc# -zdp# -zp16 -zq
-CFLAGS=-ei -wo -x -r -mc
+CFLAGS=-mc -ei -wo -x# -r
OFLAGS=-ot -ox -ob -oh -or -om -ol# -ol+
FLAGS=-0 -d2 -lr $(OFLAGS) $(CFLAGS) $(DFLAGS) $(ZFLAGS)
wcl $(FLAGS) -c $(SRC)scroll.c
sega.exe: sega.$(OBJ)
- wcl $(SEGAFLAGS) sega.$(OBJ)
+ wcl $(FLAGS) sega.$(OBJ)
sega.$(OBJ): $(SRC)sega.c
- wcl $(SEGAFLAGS) -c $(SRC)sega.c
+ wcl $(FLAGS) -c $(SRC)sega.c
test.exe: test.$(OBJ) gfx.lib
wcl $(FLAGS) test.$(OBJ) gfx.lib
void main(int argc, char *argv[])\r
{\r
int i;\r
- __segment segu;\r
+ __segment segu;
+ void __based(__self) *pee;\r
struct list __based(segu) *head;\r
struct list __based(segu) *p;\r
\r
/* allocate based heap */\r
- segu = _bheapseg( 1024 );\r
+ segu = _bheapseg( 65536 );\r
if( segu == _NULLSEG ) {\r
printf( "Unable to allocate based heap\n" );\r
exit( 1 );\r
\r
/* create a linked list in the based heap */\r
head = 0;\r
- for( i = 1; i < 10; i++ ) {\r
+ for( i = 1; i < 4096; i++ ) {\r
p = _bmalloc( segu, sizeof( struct list ) );\r
if( p == _NULLOFF ) {\r
printf( "_bmalloc failed\n" );\r
\r
/* traverse the linked list, printing out values */\r
for( p = head; p != 0; p = p->next ) {\r
- printf("Segu = %04X %FP", p, p);\r
- printf( " Value = %d\n", p->value );\r
+ if(p==head || p->next==0 || p==pee){
+ printf("Segu = %04X", p); printf( " Value = %d\n", p->value );
+ }\r
}\r
+
+ printf("program=%FP\n", *argv[0]);
+ printf("seg=%04X\n", segu);
\r
/* free all the elements of the linked list */\r
for( ; p = head; ) {\r
}\r
/* free the based heap */\r
_bfreeseg( segu );
- printf("program=%P\n", *argv[0]);
- printf("seg=%P\n", segu);\r
}\r