Use miminal config file and bare-bone custom CRT.

This commit is contained in:
giomba 2023-10-11 22:07:04 +02:00
parent 2645501186
commit 640314be8a
4 changed files with 17 additions and 8 deletions

View File

@ -1,6 +1,7 @@
PROJECT := demo
SRC = \ SRC = \
src/ceda_print.c \ src/ceda_print.c \
src/entrypoint.c \
src/main.c \ src/main.c \
\ \
@ -10,11 +11,14 @@ ECHO := @echo
QUIET := @ QUIET := @
OUTDIR := build OUTDIR := build
$(OUTDIR)/main.prg: $(OUTDIR)/main.rom $(OUTDIR)/$(PROJECT).prg: $(OUTDIR)/$(PROJECT)_code_compiler.bin
dd if=$< of=$@ bs=1 seek=2 echo -n -e '\x00\x10' > $@
cat $< >> $@
$(OUTDIR)/main.rom: $(OBJ) | $(OUTDIR) $(OUTDIR)/$(PROJECT)_code_compiler.bin: $(OBJ) | $(OUTDIR)
zcc +z80 -create-app --no-crt -m -o $@ $? zcc +conf.cfg \
-crt0=src/crt.asm \
-m -o $(OUTDIR)/$(PROJECT) $?
%.o: %.c %.o: %.c
zcc +z80 -c -o $@ $< zcc +z80 -c -o $@ $<

0
conf.cfg Normal file
View File

View File

@ -1,9 +1,13 @@
SECTION code_compiler
org $1000
EXTERN _main EXTERN _main
entrypoint: PUBLIC __Start
__Start:
ld sp,0xc000 ld sp,0xc000
call _main call _main
jp ASMPC jp ASMPC

View File

@ -1,8 +1,9 @@
#include "ceda_print.h" #include "ceda_print.h"
int globalvar = 0x7777;
int main(void) { int main(void) {
ceda_print("Hello world!"); ceda_print("Hello world!");
return 0; return 0;
} }