Open bazz1tv opened 8 years ago
so tell me, why can we do jmp label
but not lda label
?
There is no 8-bit jmp, so 16-bit becomes the default.
OK, and why does lda #label
work?
On Sat, Apr 30, 2016 at 11:25 AM, nicklausw notifications@github.com wrote:
There is no 8-bit jmp, so 16-bit becomes the default.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/vhelin/wla-dx/issues/107#issuecomment-215973126
Michael Bazzinotti Technologist & Musician http://www.bazz1.com
[image: Attleboro-low rez] http://locations.schoolofrock.com/attleboro http://locations.schoolofrock.com/attleboro
Not sure. Will try to find out next time I'm at a computer.
https://github.com/vhelin/wla-dx/blob/master/opcodes_65816.c Odd...there is no lda #16-bit-value
. There is, however, a lda 16-bit-value
. Your example, when linked, uses 0xA9 for lda #label
which is not the right opcode. I think it has to do with opcode typing; the linker thinks that with absolute addressing, the 8-bit kind is just the universal kind. With immediate addressing, however, it knows that there is a 16-bit version to be used.
I need to investigate how opcode types are carried into the linker, if at all. They might just be used by the assembler.
Well wait, WLA appears to pick up on opcode size on its own. That's probably why the absolute addressing makes no error, it knows to be 16-bit.
...And apparently WLA doesn't use the wrong opcode for absolute addressing, either. I'm stupid.
Your example, when linked, uses 0xA9 for lda #label which is not the right opcode.
Actually, that's the right opcode.
Everybody, the point of the conversation is deduct why immediate addressing of a label without hinting works fine for 16-bit, but not absolute addressing (and likely the other non-immediate addressing modes as well), and to see if this ability can be transversed into the other addressing modes.
As I said, opcode size tracking. WLA knows that a is 16-bit, so lda #label
works because it assumes label is 16-bit. However, lda label
could be anything.
Sounds right. That's much clearer
copy the
bug_exhibition/65816/template_project
directory and use the following code snippet as yourmain.s
, then simply usemake
Please read the headline blurb below