Trying to compile a ProDOS program with cc65

5 posts / 0 new
Last post
Offline
Last seen: 6 days 17 hours ago
Joined: Aug 9 2018 - 07:31
Trying to compile a ProDOS program with cc65

I'm so close, but something is amiss when I'm trying to create a "Hello World" program for Prodos, that tuns

I'm using Applewin as an emulator and the latest Windows snapshot of cc65.

My simple hello world program is as follows:
---------------------
#include
void main()
{
printf("Hello World!\n");
}
-----------------------

I have created a new .po disk image and it has Prodos v 2.4.2 (The one made by John Brooks). I also added the loader.system file (Which was renamed to hello.system to load my program) In ciderPress I set it as a file type of SYS with an AUX of $2000

I compiled my hello world program with the following:
-----------------
cl65 -t apple2enh -C apple2enh.cfg hello.c
-----------------

I used Ciderpress to add the resultant "hello" file to the disk. I set it as filetype "BIN" and an aux of "$0803" (According to CC65, this is the default memory address for programs linked against apple2enh)

The loader announces it is "Loading "HELLO" and then bombs to the monitor.

I'm either not using the right compile switches, or my transfer of the program the disk via Ciderpress is incorrect. Can anyone give me some assistance on compiling this right? I figure this is an everyday exorcise for Apple II developers.

Offline
Last seen: 3 days 19 hours ago
Joined: Jul 25 2018 - 23:41
How does the loader work, how

How does the loader work? What is it supposed to do, and how does it know to load your hello.bin?

Also, does the hello.bin work from a regular brun command?

Offline
Last seen: 6 days 17 hours ago
Joined: Aug 9 2018 - 07:31
It doesn't "BRUN HELLO" gives

It doesn't "BRUN HELLO" gives me a syntax error. I decided to look at the compiled binary and it appears there is some header thing going on (The first byte is a 0, along with some address locations). All the tutorials are telling me use AppleCommander, which I could never get to run on my system (Clicking on the java icon did nothing)

Looking further, the hello program is almost 3K in size.

Looking on Applecommander's page, it appears to read this header, so I'm going to have to battle to get it running. It kind of irks me that that all the tutorials I'm finding assume I just have a linux box on hand to do all this. :/

Offline
Last seen: 6 days 17 hours ago
Joined: Aug 9 2018 - 07:31
As an update - I goit

As an update - I goit applecommander to run and I decided to follow a few tutorials. They all failed. I have an example one here (I modified it so that I could use the Windows command line)

First Applecommander makes invalid ProDOS disks. Using the -pro140 switch crates a disk that will dump to the monitor if you boot it (as opposed to getting a "PRODOS NOT FOUND"
Creating a blank prodos disk image in CiderPress works fine

Adding the file in AppleCommander using the --cc65 argument crates the BIN, but with an AUX of $0500

doing a BRUN from Applesoft results in a "NO BUFFERS AVAILABLE" error

I can't imagine it's this painful to get a cross compiler going on an apple...

Offline
Last seen: 3 days 19 hours ago
Joined: Jul 25 2018 - 23:41
Syntax error sounds like you

Syntax error sounds like you’re not using a basic version that has BRUN command, also,some older version won’t recognize the command if you type it lowercase. Make sure it’s uppercase. Are you using basic that came with Prodos ?

Log in or register to post comments