hoglet67 / 6502Decoder

6502/65816/6800 Bus Protoco/Instruction Stream (for logic analysis capture files)
GNU General Public License v3.0
28 stars 9 forks source link

65816 memory emulation #13

Open dominicbeesley opened 3 months ago

dominicbeesley commented 3 months ago

Does this support memory modelling in 65816 mode?

I'm using the following command: decode6502 --mem=F0F --cpu=65816 -ahisy

but it doesn't seem to log memory writes nor does it pick up some "deliberate" mistakes where my d,X addressing mode was picking up the wrong byte.

00C01C : 86 03 : STX 03 : 3 : A=??03 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=???? 00C01E : E6 03 : INC 03 : 5 : A=??03 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=???? 00C020 : A5 03 : LDA 03 : 3 : A=??80 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=???? 00C022 : 45 03 : EOR 03 : 3 : A=??00 X=007F Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=1 C=0 E=1 PB=00 DB=?? DP=???? 00C024 : 85 05 : STA 05 : 3 : A=??00 X=007F Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=1 C=0 E=1 PB=00 DB=?? DP=???? 00C026 : E6 03 : INC 03 : 5 : A=??00 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=???? 00C028 : A2 02 : LDX #02 : 2 : A=??00 X=0002 Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=???? 00C02A : B5 03 : LDA 03,X : 4 : A=??00 X=0002 Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=1 C=0 E=1 PB=00 DB=?? DP=???? 0

The Load at C02A is now working correctly but when it wasn't (it was bringing back 81) the registers said A=81 and I'd have expected a prediction fail.

Is it just that the 65816 emulation is not doing the memory modelling. It has been dead useful so far getting simple stuff working but now I'm getting to the more tricksy addressing modes it would be good to have it working. If it's not done for 816 - where should I start, I'm happy to put some effort in to adding it!

D

hoglet67 commented 3 months ago

It should log writes, as long as it can figure out the effective address.

In your case the STX 03 is not logged because the DP register is unknown, so the effective address is unknown.

If you know the value, you can force it with the --dp= option.

Let me know if this works.

hoglet67 commented 3 months ago

Oh, and also watch out for the DB register also being unknown, which will affect writes from other addressing modes. This can be forced with --db= option.

dominicbeesley commented 3 months ago

Ah of course. I suspected it would be user error!

On Wed, 26 Jun 2024, 17:50 David Banks, @.***> wrote:

Oh, and also watch out for the DB register also being unknown, which will affect writes from other addressing modes. This can be forced with --db= option.

— Reply to this email directly, view it on GitHub https://github.com/hoglet67/6502Decoder/issues/13#issuecomment-2192194390, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDUWGQMRSL34RIXAHPDQ2DZJLWOHAVCNFSM6AAAAABJ6IDLOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGE4TIMZZGA . You are receiving this because you authored the thread.Message ID: @.***>

hoglet67 commented 3 months ago

Good stuff....

BTW, I'm thinking of adding 6800 emulation to the 6502 decoder, as it's so similar architecturally.

dominicbeesley commented 3 months ago

I could have done with that a while ago...I may revisit the 6800 stuff if you find anything interesting. It's a fun cpu but takes a while getting your head round the missing addressing modes. I was considering a BBC Basic port but couldn't think of a good reason to do it!

D

On Wed, 26 Jun 2024 at 18:05, David Banks @.***> wrote:

Good stuff....

BTW, I'm thinking of adding 6800 emulation to the 6502 decoder, as it's so similar architecturally.

— Reply to this email directly, view it on GitHub https://github.com/hoglet67/6502Decoder/issues/13#issuecomment-2192225797, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDUWGRHTTEY6LWRUKZAHMDZJLYEPAVCNFSM6AAAAABJ6IDLOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGIZDKNZZG4 . You are receiving this because you authored the thread.Message ID: @.***>