I'm trying to use xa
to assemble some 65816 assembly, but it complains about "overflow errors" when it encounters 16 bit immediate operands, such as
bit #$100
This does not happen for arguments that fit in 1 byte, so it's clearly assuming an 8 bit accumulator rather than a 16 bit one. How can I indicate that the accumulator should be 16 bit? I am using the -w
switch to enable 65816 opcodes, but that does not help. In wla-dx
one can suffix the opcode with .w to explicitly tell it to use the 16 bit version of the opcode, but xa
doesn't understand that.
A more thorough read of the xa
man page revealed these pseudo-ops:
.as: Makes A register 8 bit
.al: Makes A register 16 bit
.xs: Makes XY registers 8 bit
.xl: Makes XY registers 16 bit
So I solved the problem by inserting .al : .xl
at the beginning of the file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.