diff --git a/samples/Makefile b/samples/Makefile index 05d97b6..b9359a7 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -1,7 +1,13 @@ AS = wdc816as +CC = wdc816cc ASFLAGS = -L +CCFLAGS = -LT -ML -I../include all: instructions.obj hello1.obj hello2.obj hello3.obj labels.obj ref_only.obj +%.obj : %.c + $(CC) $(CCFLAGS) $< -o $@ + + %.obj : %.asm $(AS) $(ASFLAGS) $< -o $@ diff --git a/samples/stdio_test.c b/samples/stdio_test.c index c6cad94..006728c 100644 --- a/samples/stdio_test.c +++ b/samples/stdio_test.c @@ -37,4 +37,14 @@ int creat(const char *name, int mode) { int unlink(const char *name) { return -1; -} \ No newline at end of file +} + +int isatty(int fd) { + return -1; +} + + +#pragma section udata=heap +char __heap[8092]; +void *heap_start = (void *)__heap; +void *heap_end = (void *)&__heap[8092]; diff --git a/samples/stdio_test.lst b/samples/stdio_test.lst index d2b54ff..491d198 100644 --- a/samples/stdio_test.lst +++ b/samples/stdio_test.lst @@ -1,4 +1,4 @@ - Mon Jan 16 2017 11:21 Page 1 + Mon Jan 16 2017 13:57 Page 1 *************************************** @@ -59,7 +59,7 @@ 50 data 51 L1: 52 00:0000: 66 69 6C 65 db $66,$69,$6C,$65,$2E,$74,$78,$74,$00,$77, - Mon Jan 16 2017 11:21 Page 2 + Mon Jan 16 2017 13:57 Page 2 $62,$00 @@ -120,7 +120,7 @@ 104 00:004F: 0B phd 105 00:0050: 5B tcd 106 00000004 fd_0 set 4 - Mon Jan 16 2017 11:21 Page 3 + Mon Jan 16 2017 13:57 Page 3 107 ; return -1; @@ -181,7 +181,7 @@ 162 ends 163 efunc 164 ; - Mon Jan 16 2017 11:21 Page 4 + Mon Jan 16 2017 13:57 Page 4 165 ;size_t write(int fd, void *buffer, size_t count) @@ -242,7 +242,7 @@ 219 00:00A8: A9 FF FF lda #$ffff 220 00:00AB: AA tax 221 00:00AC: A9 FF FF lda #$ffff - Mon Jan 16 2017 11:21 Page 5 + Mon Jan 16 2017 13:57 Page 5 222 L20: @@ -303,7 +303,7 @@ 277 ;int unlink(const char *name) { 278 code 279 xdef ~~unlink - Mon Jan 16 2017 11:21 Page 6 + Mon Jan 16 2017 13:57 Page 6 280 func @@ -338,10 +338,71 @@ 309 ends 310 efunc 311 ; - 312 xref ~~fopen - 313 xref ~~fclose - 314 end + 312 ;int isatty(int fd) { + 313 code + 314 xdef ~~isatty + 315 func + 316 ~~isatty: + 317 longa on + 318 longi on + 319 00:00FB: 3B tsc + 320 00:00FC: 38 sec + 321 00:00FD: E9 00 00 sbc #L27 + 322 00:0100: 1B tcs + 323 00:0101: 0B phd + 324 00:0102: 5B tcd + 325 00000004 fd_0 set 4 + 326 ; return -1; + 327 00:0103: A9 FF FF lda #$ffff + 328 L29: + 329 00:0106: A8 tay + 330 00:0107: A5 02 lda