Ninja'd twice. Let me restate the question:
In README.txt in the asm6 distribution, loopy wrote:
INCLUDE (also
INCSRC)
Assemble another source file as if it were part of the current source.
Code:
INCLUDE whatever.asm
But from what folder does ASM6 try to read
whatever.asm? Say I have this setup:
Code:
~/develop/corral$ ls src
main.s
nes.inc
[other files omitted]
~/develop/corral$ asm6 -l src/main.s corral.nes
Or on Windows:
Code:
C:\Users\pino\develop\corral>dir /b src
main.s
nes.inc
[other files omitted]
C:\Users\pino\develop\corral>asm6 -l src\main.s corral.nes
Which line should appear in
src/main.s?
Code:
; This works if paths are relative to the current working directory (CWD)
include src/nes.inc
; This works if paths are relative to the directory of the including file
include nes.inc
End of restated question.
I haven't used ASM6, but the definition of
include() starting at line 1633 implies that paths of included files are CWD-relative. To work around this, you'll want to put your batch file that calls asm6 in the same folder, as Windows sets the CWD to the folder containing the batch file. If the folder containing
asm6.exe is not on your
Path, you'll want to put the full path to
asm6.exe in your batch file that calls asm6.
Digression for those following multiple assemblers:
The last version of ca65 on cc65.org (2.12 or thereabouts) treated paths referenced in
.include as relative to the CWD. Around the time cc65 moved to GitHub and adopted the permanent version number 2.14,
three breaking changes were committed. One was ca65 treating paths as relative to the directory of the including file, not the CWD. (The others were ca65
not accepting negative byte values without
< or
.feature force_range and ld65 requiring the output file to appear before source files on the command line.) The
.incbin statement in ca65 still appears to operate relative to the CWD.