It is currently Fri Jul 28, 2017 11:42 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon May 01, 2017 4:15 pm 
Offline

Joined: Mon May 01, 2017 4:11 pm
Posts: 21
When I load a rom into memory, I mirror it to fit into the whole Cartridge space as per usual. The reset vector at $FFFC points to $9EC7 which is value 0x2B. As far as I can tell this is not a valid opcode. Can someone help me with this? (Btw the rom is Donkey Kong).


Top
 Profile  
 
PostPosted: Mon May 01, 2017 4:37 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 208
You're interpreting the bytes in the wrong order - the reset vector points to $C79E, not $9EC7.
The 6502, like x86 CPUs, uses little endian encoding.


Top
 Profile  
 
PostPosted: Mon May 01, 2017 6:38 pm 
Offline

Joined: Mon May 01, 2017 4:11 pm
Posts: 21
Sour wrote:
You're interpreting the bytes in the wrong order - the reset vector points to $C79E, not $9EC7.
The 6502, like x86 CPUs, uses little endian encoding.


I completely forgot, lol. Thanks!


Top
 Profile  
 
PostPosted: Mon May 01, 2017 6:39 pm 
Offline

Joined: Mon May 01, 2017 4:11 pm
Posts: 21
the opcode is 78 now. is that still valid? I'm not entirely sure.


Top
 Profile  
 
PostPosted: Mon May 01, 2017 6:44 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 9808
Location: Rio de Janeiro - Brazil
If you mean $78, that's SEI, the first instruction in 99.9% of all 6502 programs, so yeah, it's valid. :D


Top
 Profile  
 
PostPosted: Mon May 01, 2017 6:49 pm 
Offline

Joined: Mon May 01, 2017 4:11 pm
Posts: 21
I think I just now understood what the opcode matrix on the wiki means. I found another table that just lists values and their opcodes, and I realize that the table columns are just offsets from the rows, and the opcode is the row+column added together. Sorry, this is my first time doing emulation of this scale so I'm learning as I go along.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group