Sakrac / x65

6502 Macro Assembler in a single c++ file using the struse single file text parsing library. Supports most syntaxes.
MIT License
38 stars 7 forks source link

Force Absolute Addressing not working #1

Closed dwsJason closed 5 years ago

dwsJason commented 5 years ago

In 65816 mode, forcing absolute addressing doesn't work.

Input source: lda.z $101030 // .z zero page lda.a $101030 // .a force absolute lda.l $30 // .l force long

---- output on the listing $0004 a5 30 lda $30 3+2 lda.z $101030 // .z zero page $0006 af 30 10 10 lda $101030 5+ lda.a $101030 // .a force absolute $000a af 30 00 00 lda $000030 5+ lda.l $30 // .l force long

As an aside, the WDC standard for forcing these modes would be lda <$30 ; Force Direct/ Zero page lda |$30 ; Force Absolute lda >$30 ; Force Long

I really like your assembler.

Sakrac commented 5 years ago

Thanks for looking at my assembler! I don't use 65816 a lot so not surprised I overlooked this, a fix for force absolute has been added.

I've looked at the WDC standard a bit but have a hard time reading it so I haven't considered adding it, < and > are commonly used for low and high byte of a value in 6502 assemblers and it might be hard to distinguish unless I add a command line option for WDC and disable common use of < and >. I'll consider it a 100% vote for supporting it from my known users though :)

dwsJason commented 5 years ago

Wow, thanks so much for fixing the force absolute! If you're data bank is not zero, or your direct page is not at zero, $0030, and $30 would be completely different memory addresses. So when using 816, I find it best to force addressing in most scenarios. I will test it out after work tonight.

For the <, |, and > address modifiers. Maybe it would be possible without impacting the other uses of <, >, and ^. Since in the former, you are modifying the addressing mode, and in the latter you are dealing with an immediate value.

With that said, you know your code far better than anyone else. It is a request to add support for it, but not a request to add a command-line switch, or remove support for the other use cases.

I have to warn you, if you keep fixing things like this, I will end up writing something large in your assembler. And that might lead to more reports.

Thank you again!

On Wed, Sep 18, 2019 at 3:22 PM Carl-Henrik Skårstedt < notifications@github.com> wrote:

Thanks for looking at my assembler! I don't use 65816 a lot so not surprised I overlooked this, a fix for force absolute has been added.

I've looked at the WDC standard a bit but have a hard time reading it so I haven't considered adding it, < and > are commonly used for low and high byte of a value in 6502 assemblers and it might be hard to distinguish unless I add a command line option for WDC and disable common use of < and

. I'll consider it a 100% vote for supporting it from my known users though :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Sakrac/x65/issues/1?email_source=notifications&email_token=AAYDWBEBHD5FDEZWFIRMUILQKJ5YTA5CNFSM4IXYDRC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7BFKTY#issuecomment-532829519, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYDWBHCI3DOHDHYXWIDH23QKJ5YTANCNFSM4IXYDRCQ .

dwsJason commented 5 years ago

Confirm fixed, forcing absolute works!