I'm having trouble understanding why I'm getting a "Symbol already defined" error from acme. It seems to happen when I include a .a file that triggers a second assembler pass, but I'm not sure what to do to mitigate the problem. I managed to reproduce the problem with a couple small files:
Code:
; test.a
!to "test", plain
!cpu 65c02
* = $8000
!src "lib.a"
reset
jmp a
* = $fffc
!word reset
!word $0
Code:
; lib.a
!ifdef lib_a !eof
lib_a = 1
a
jmp b ; Triggers a second pass because `b` is not known here
b
jmp a
I tried wrapping the "reset" label in !ifndef reset { ... }, but then the assembler produces an empty file. What am I doing wrong?
(edit): I don't get the same error if I inline the contents of 'lib.a' directly in 'test.a', so it's something about the !src call.