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

65816 Immediate Modes #6

Closed dwsJason closed 5 years ago

dwsJason commented 5 years ago

The 65816 immediate modes, don't respect the A8, and I8 settings.

example listing below: $000d e2 30 sep #$30 3 sep #$30 I8 $000f a2 34 12 ldx #$1234 2+ ldx #$1234 A8 $0012 a9 34 12 lda #$1234 2+ lda #$1234

Code generation in this case, should be limited to A2 34, and A9 34

Sakrac commented 5 years ago

This was a real bug, I was accidentally stripping all 16 bit immediate modes, please check it!

dwsJason commented 5 years ago

My lst output below, unfortunately, doesn't seem fixed.

$000d e2 30 sep #$30 3 sep #$30 I8 $000f a2 56 34 ldx #$3456 2+ ldx #$3456 A8 $0012 a9 56 34 lda #$3456 2+ lda #$3456

Sakrac commented 5 years ago

You're right! I was checking the value and letting it override the I8/A8 keywords which was totally wrong. This should be fixed now!

dwsJason commented 5 years ago

Confirmed Fixed with latest. Thank you!