Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user bulb ! (Registered 2013-05-23) You are not logged in 
CSDb User Forums


Forums > C64 Coding > 6502 instruction decoding
2012-02-29 19:14
JackAsser

Registered: Jun 2002
Posts: 931
6502 instruction decoding

Why is it that STA-opcodes always gets an implicit page-crossing penalty in comparison to their LDA counter parts?

F.e.
lda abs,x is 4/5 depending on page crossing
sta abs,x is always 5 independent of page crossing
 
... 8 posts hidden. Click here to view all posts....
 
2012-02-29 22:07
JackAsser

Registered: Jun 2002
Posts: 931
RMW has two write cycles? Wow. So, on Nintendo, with auto incrementing vram-pointer when writing to $2007, this would mean that it would increment the pointer TWO times if I do say, INC $2007. Or rather, THREE times because of the one load cycle as well?
2012-02-29 22:11
TWW

Registered: Jul 2009
Posts: 283
Quote: It should be mentioned that STA $1234,X reads from the same address as LDA $1234,X in step 4.

And yes, this wrong read can acknowledge IRQs. Example:

    LDX #$FF
    LDA $DC0E,X

This would read from $DC0D in cycle 4 and $DD0D in cycle 5, acknowledging both, IRQs and NMIs :)


That is amazing! 8-D

so no more:

    lda $dc0d
    lda $dd0d


just:

    ldx #$ff
    lda $dc0e,X


cool!
2012-02-29 22:33
MagerValp

Registered: Dec 2001
Posts: 665
Quoting Graham
A clean way to acknowledge VIC2 IRQs would be LDA $D019 STA $D019.

Or rather LDA #$FF : STA $d019.
2012-02-29 22:56
iAN CooG

Registered: May 2002
Posts: 1159
I find asl $d019 way simpler, all bits get read/written.
2012-03-01 01:33
JackAsser

Registered: Jun 2002
Posts: 931
Quote: I find asl $d019 way simpler, all bits get read/written.

Checking out visual6502.org and the forums there it became clear that the actual instruction decoding is just an internal PLA in the CPU. It takes the current opcode and cycle into an array and get an operation value out which it executes.

I want a dump of this ROM. There is one online but it's obviously totally flawed, and the dude who did it also said he didn't know what lines that were what.

Using the visual6502 one can transcribe it properly, but it's a pain to do it. Anybody did it already?
2012-03-01 09:28
MagerValp

Registered: Dec 2001
Posts: 665
Quoting JackAsser
Using the visual6502 one can transcribe it properly, but it's a pain to do it. Anybody did it already?

No me, but I'm also interested in it. It'd make a pretty awesome cycle exact 6502 emulation core.
2012-03-01 09:33
JackAsser

Registered: Jun 2002
Posts: 931
Quote: Quoting JackAsser
Using the visual6502 one can transcribe it properly, but it's a pain to do it. Anybody did it already?

No me, but I'm also interested in it. It'd make a pretty awesome cycle exact 6502 emulation core.


Exactly + less code to implement it probably given you implement the ~130 sub operation (compared to 256 special case instruction as we do today more or less)
2012-03-02 19:11
Zer0-X

Registered: Aug 2008
Posts: 34
So you're after the table like this (from the "wrong" CPU tho)?:

http://oms.wmhost.com/misc/6502_inst.png
2012-03-02 19:28
Groepaz

Registered: Dec 2001
Posts: 5807
Quote:
Exactly + less code to implement it probably given you implement the ~130 sub operation (compared to 256 special case instruction as we do today more or less)

not really... if you look at a typical cycle exact cpu core, it already works with a lookuptable and sub operations very similar to what the cpu does :)
2012-03-02 23:55
JackAsser

Registered: Jun 2002
Posts: 931
Quote: So you're after the table like this (from the "wrong" CPU tho)?:

http://oms.wmhost.com/misc/6502_inst.png


Yes, but I have deciphered the die-scan now into a proper table. There are errors though that I must fix first.
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.


Search CSDb
Advanced
Users Online
Groepaz/Hitmen
hedning/G×P
Guests online: 24
Top Demos
1 Edge of Disgrace  (9.7)
2 Coma Light 13  (9.7)
3 Daah, those acid pil..  (9.6)
4 Deus Ex Machina  (9.3)
5 Andropolis  (9.3)
6 Te-Te-Te-TechTech It..  (9.3)
7 +H2K  (9.2)
8 Artphosis  (9.2)
9 2011 - A Press Space..  (9.2)
10 GOLC  (9.1)
Top Groups
1 Booze Design  (9.4)
2 Crest  (9.4)
3 Oxyron  (9.4)
4 Maniacs of Noise  (9.2)
5 Eagle Soft Incorpora..  (9.2)
Top Crackers
1 Mr.Z  (9.9)
2 Mr Zero Page  (9.8)
3 Mitch  (9.8)
4 The Omega Man  (9.8)
5 Oleander  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2013
Page generated in: 0.258 sec.