News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

SDCC Compile C

Started by IndyUK, 18:01, 29 June 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IndyUK

Hi Folks,

I'm trying out SDCC as I've read it's a very good C compiler for Z80. I downloaded a sample CPC project to try and understand the process of compilation but, I'm having some difficulties in getting things setup. I've put together the following batch file to simplify the process but I'm not getting the desired result.

sdcc -mz80 --fno-omit-frame-pointer --code-loc 0x6038 --data-loc 0 --no-std-crt0 crt0_cpc.rel putchar_cpc.rel test.c

hex2bin.exe test.ihx

CPCDiskXP.exe -File test.bin -AddAmsdosHeader 6000 -AddToNewDsk Test.dsk

I think it's probably not helping the fact I don't know exactly what the params are for/doing. The program I'm compiling is 

#include <stdio.h>

main()
{
  printf("Hello world");
  while(1) {};
}

Instead of getting a "Hello World" message on the CPC, I'm getting a "*** PROGRAM LOAD FAILED ***". Could somebody give me some help with this please?

Thanks in advance.

IndyUK

Fixed. Corrupt/Incorrect .rel files.

awergh

I would recommend using cpctelera as it will setup the whole toolchain for you.
It also comes with a whole lot of examples so you can try out the functionality it provides.

Powered by SMFPacks Menu Editor Mod