Asm6809 has always been great, but here's a quick question regarding indexed addressing. It seems asm6809 (also the old Perl version) handles indexed addressing differently than other 6809 assemblers that I have tested. The following simple program demonstrates the difference:
Code: Select all
leax welcome,pc
loop lda ,x+
beq end
jsr $800c
bra loop
end rts
welcome fcc "Hello, Dragon", 13, 0
DREAM will encode the LEAX instruction as 30 8c 0a, i.e. using the
offset of
welcome as the index. The program prints "Hello, Dragon", as expected. asm6809 generated 30 8d xx xx for the LEAX instruction, encoding the
absolute address of the welcome message as the index, hence printing a random string from memory. (xx xx depends on the location of the program in memory.)
Is this intentional?
Regards,
-- Rolf