I am trying to use the xa assembler to write some 6502 code. According to the documentation, I can define a zeropage segment using the .zero
pseudo-op. I was hoping to do something like this:
.zero
tmp1: .byt 0
tmp2: .byt 0
.text
lda $12
sta tmp1
lda $34
sta tmp2
I am hoping for this output:
a512 8500 a534 8501
But trying to assemble the above fails with:
foo.s:line 1: 1000:Illegal segment error
According to the docs, "These pseudo-ops are valid in relative and absolute modes". Just for kicks, I tried enabling relocatable mode (xa -R ...
), which compiles the code without error, but now I have an o65
format file instead of raw assembly output (and linking that with ldo65
produces an o65
binary).
Is it possible to use segment pseudo-ops in xa while still producing raw assembly output?
@Raffzahn asked for complete command lines. Assuming the code is in file xatest.s
, this fails:
xa xatest.s
This fails:
xa -bz 0 -bt 512 xatest.s
This completes without error, but doesn't produce useful output:
xa -R xatest.s
.text
is only allowed in relocatable format. Maybe the issue is just reported with a wrong line number? Also, in non relocatable mode the Assembler needs a well a hint were to start. Next, when using relocatable format, the linker needs to be given addresses for each segment. This can be done with the assembler as well (-b*
), so maybe theres somethign to try (P.S.: addin the whole command line with all options used may be a good idea).