Why is no .o file build?

All aspects of programming on the Commander X16.
Post Reply
Slevin
Posts: 29
Joined: Wed Mar 06, 2024 8:04 pm

Why is no .o file build?

Post by Slevin »

I'm following SlithyMatt's x16-assembly-tutorial, which btw is an awesome introduction to Assembly and the basics of 65C02. However, I've noticed, that all examples I compile, there is no .o-file build.

I'm using a Windows machine and have all the required tools set up as explained here SlithyMatt's x16-hello-cc65.

Whether I now run the ca65.exe or the cl65.exe, in both cases no .o-file is build. For example the following command

Code: Select all

cl65 -t cx16 -o TEST.PRG -l test.list test.asm
creates TEST.PRG and test.list, but nothing else.

Does anybody know how to solve this issue?
Many thanks
kelli217
Posts: 512
Joined: Sun Jul 05, 2020 11:27 pm

Re: Why is no .o file build?

Post by kelli217 »

What would be the output .o file is named what the -o option indicates, when that option is present on the command line. In your example case, the output file is TEST.PRG.
Johan Kårlin
Posts: 286
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

Re: Why is no .o file build?

Post by Johan Kårlin »

ca65 is the assembler and cl65 is a combined compiler and linker. If you use the compiler cc65, you will get an object file.
Slevin
Posts: 29
Joined: Wed Mar 06, 2024 8:04 pm

Re: Why is no .o file build?

Post by Slevin »

Thanks for this clarification, Johan Kårlin. So that is just a missunderstanding and Matt probably didn't mean to mention the oputput of an o-file by the cl65, but thought instead of the compiler than of the linker.

That is, that the compiler is for the C language only and will produce an object file which contains assembly code, while the linker will take all the object/assembly files and put them together to an executable, right?

Thanks again and have a nice week
Johan Kårlin
Posts: 286
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

Re: Why is no .o file build?

Post by Johan Kårlin »

Slevin wrote: Wed Mar 13, 2024 5:49 amThat is, that the compiler is for the C language only and will produce an object file which contains assembly code, while the linker will take all the object/assembly files and put them together to an executable, right?

Thanks again and have a nice week
That is exactly right. Good luck with your coding adventures. I have struggled with a lot of things when learning to program for the X16. Luckily, this is a very helpful community. 😊
Post Reply