Mobsie wrote: ↑Sun Mar 13, 2022 2:49 pm
Hi, you compare kickc with cc65? Or you just a kickc user)
I think i will try to compare it because i read a lot about kickc. I need to understand how made the target file first.
I love KickC, compared to cc65 it produces very efficient code, mostly thanks to the paradigm of not using stack for passing parameters (so function can't be reentrant -- but it's not a big drawback). So it has became the compiler of choice for my 6502 projects when I don't write in assembly directly (for which I have my own dedicated macro preprocessor/assembler).
Pros:
- very optimized and efficient
- doesn't link bloated libraries
- project is alive and rather actively maintained
Cons:
- it has lot of bugs, sometimes it fails to compile with strange errors or java null pointer exception
- slow to compile (when optimizations are on)
- non standard C
- uses KickAssembler for compile/link, it doesn't produce a classic .lst file (as far as I know)
For the target files, I use the following:
kickc/creativision_16KROM.ld
Code: Select all
// Creativision 16KROM cartdrige, with 1KRAM, 2KB BIOS
.file [name="%O", type="prg", segments="Program"]
.segmentdef Program [segments="Code, Data"]
.segmentdef Code [start=$8000,min=$8000,max=$bfff,outBin="creativision_codeseg.bin"]
.segmentdef Data [start=$0200,min=$0200,max=$03ff,outBin="creativision_dataseg.bin"]
kickc/creativision_16KROM.tgt
Code: Select all
{
"extension": "prg",
"link": "creativision_16KROM.ld",
"start_address": "0x8000",
"cpu": "ROM6502",
"interrupt": "hardware_all",
"emulator": "echo",
"defines": {
"__CREATIVISION__": 1,
"CREATIVISION": 1,
"CREATIVISION_16KROM": 1,
"__KICKC__": 1
}
}
and compile with:
Code: Select all
kickc -targetdir kickc -t creativision_16KROM demo.c -o demo.prg -e
then I take the resulting "creativision_codeseg.bin" (not .prg) and use it to create a .BIN cart file (with start address at $BFFC).