Page 1 of 1
Why is no .o file build?
Posted: Tue Mar 12, 2024 4:52 am
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
Re: Why is no .o file build?
Posted: Tue Mar 12, 2024 7:12 pm
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.
Re: Why is no .o file build?
Posted: Tue Mar 12, 2024 7:17 pm
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.
Re: Why is no .o file build?
Posted: Wed Mar 13, 2024 5:49 am
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
Re: Why is no .o file build?
Posted: Wed Mar 13, 2024 2:39 pm
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.