Firstly, I know I should be writing a converter for 6502Bench, but C# makes my skin crawl :O
Secondly, this may be know/documented an I just haven't found it.
It looks like if a variable is assigned a value that is < 256, the assembler treats it as 16 bit as far as instruction encoding goes.
AFAIK, there is no way for force an address to be 16bit, which in this case would temporarily be handy as the original code uses 16 bit addressing for some ZP addresses and I am currently adding a NOP after the instruction generated by beebasm to pad it. The reason I am converting to beebasm is to change the code and make some room, so I will be removing the NOPs once it works.
Code: Select all
trk_axis_hi = &9D
trk_axis_lo = &B0
CHECK_ADDR &51FB
}
.ApplyTrackAxis ;assume positive
{
ldy #&00 ;assume positive
CHECK_ADDR &51FD
lda trk_axis_lo,X ;get value
CHECK_ADDR &51FF
bpl _IsPos ;is positive, branch
CHECK_ADDR &5201
dey ;make negative
CHECK_ADDR &5202
._IsPos ;sign-extend axis value
sty trk_axis_hi,X ;sign-extend axis value
Code: Select all
MissileCommand.asm:1039: error: X indexed mode does not exist for this instruction.
sty trk_axis_hi,X ;sign-extend axis value
I haven't tried the head (wherever that is) as it is missing some other bits that I use.
PS I'm an idiot: beebasm 1.09