CA65 noob question
Moderator: Moderators
CA65 noob question
Is it possible to create a second assembly file with some .proc and call them in the main one by including the file? (like a macro)
Re: CA65 noob question
.proc is a way to limit the scope (and reduce errors caused by duplicate label names). Generally, labels defined inside the .proc will not be known to anything outside of the .proc scope.
However, you can do this with 2 colons.
proc-name::label
like
LDA Car::Toyota
I don't know about using it within a macro, but it should be possible.
However, you can do this with 2 colons.
proc-name::label
like
LDA Car::Toyota
I don't know about using it within a macro, but it should be possible.
nesdoug.com -- blog/tutorial on programming for the NES
-
- Posts: 20
- Joined: Fri Jun 26, 2020 2:57 am
- Contact:
Re: CA65 noob question
You can include one file on another using .include.
There's also a more complex alternative (which I tend to do) is this: each assembly file .exports the procs they want to be available elsewhere; each assembly file which wants to use a proc from somewhere else .imports it. Then, compile each file separately with ca65 and link them into the final rom with ld65.