Re: Avoiding Circular Dependencies CC65
Posted: Thu May 18, 2023 4:24 pm
"Declarations" as in any kind of compile-time constants that are helpful for the source files to know, but don't actually contain anything to assemble on its own.
The CX16's own kernal rom source code has a good example: banks.inc contains (among other things) a bunch of constants for which bank number is which. Any .s files that deal with bank switching will .include this file, then take advantage of those constants. Notice how banks.inc doesn't actually have anything to assemble, it's just macros and constants, but they're macros and constants useful to many files.
The CX16's own kernal rom source code has a good example: banks.inc contains (among other things) a bunch of constants for which bank number is which. Any .s files that deal with bank switching will .include this file, then take advantage of those constants. Notice how banks.inc doesn't actually have anything to assemble, it's just macros and constants, but they're macros and constants useful to many files.