-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Breaking] MOS: 65816 assembler fixes, part 2 #456
[Breaking] MOS: 65816 assembler fixes, part 2 #456
Conversation
; CHECK: R_MOS_ADDR16 .text+0x1 | ||
lda !addr16 ; CHECK: ad 00 00 | ||
; CHECK: R_MOS_ADDR16 .text+0x202 | ||
; TODO: lda addr16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently lack a 16-bit equivalent to .zeropage
. I've left these for a later PR.
lda #^addr24 ; CHECK: a9 00 | ||
; CHECK: R_MOS_ADDR24_BANK .text+0x30303 | ||
|
||
; TODO: Immediate (16-bit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently lack a way to appropriately tell the assembler to force 16-bit immediates, without using mos16()
. I've left these for a later PR.
After merging the previous change, it looks like this branch has conflicts now and needs to be synced. |
- The immediate and address modifiers (#<, #>, #^, <, !, >) now adhere to WDC recommendations as documented in the 65816 datasheet. - In particular, this means the behaviour of "lda >addr" changes, while "lda !addr" and "lda #^addr" have been introduced. - Immediate expressions now emit R_MOS_IMM8 and R_MOS_IMM16, while address expressions now emit R_MOS_ADDR8 and R_MOS_ADDR16 relocations. - Some error messages have been adjusted to more accurately represent the assembler's limitations. - Bugs in the SPC700's handling of "addr + X" and "addr + Y" addressing mode syntaxes have been fixed. - Extensive tests have been added to test for addressing mode and modifier handling. Note that this includes breaking changes for the following expressions: - "lda >addr" was previously interpreted as "lda mos16hi(addr)", but now will be interpreted as "lda mos24(addr)". This is unlikely to break production code. - "lda <addr8" was previously interpreted as "lda mos16lo(addr)", but now will be interpreted as "lda mos8(addr)". As the two relocations are functionally (but not semantically) equivalent, this should not break production code. - Likewise, functional (but not semantic) changes involve the relocations emitted by immediate expressions ("lda #val").
This matches WDC 65816 and 65EL02 recommendations, respectively.
8fe7435
to
abb9201
Compare
Ah, sorry; should be fixed now. |
More fixes for #454 . These come after #455 .
Note that this includes breaking changes for the following expressions: