how does hex reading work?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
CKY-2K/Clay Man
Posts: 214
Joined: Sun Apr 01, 2007 2:10 pm

how does hex reading work?

Post by CKY-2K/Clay Man »

When you execute a file, how does it start up?
Does it start at the top of the file, and the values tell it which address to go next?

I need to get everything straight.
Image
Here to at least get an idea of how the NES works. I mean I know alot of the basic things, but this place'll help me grasp more how NES functions.
Major respect to NES developers.
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

Are you talking about PC executables?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

On NES, at power on, the mapper computes which banks are fixed and which are switchable, and the initial values of the switchable banks. Then the CPU reads a 16-bit little-endian value from the locations mapped to $FFFC and $FFFD in CPU space and sets the program counter to this value.
WedNESday
Posts: 1231
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday »

.nes ROM's don't equal executables. He isn't being very specific.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

I didn't even understand the question, as it really isn't clear what you're talking about.

If you are talking about NES binaries, execution starts at the location pointed by the values at $FFFC and $FFFD, as tepples said. Programs are just a sequence of commands, and the CPU auto-increments the Program Counter (the internal register that point to the next instruction to execute) as it reads and executes each command.

Is that what you're talking about?
CKY-2K/Clay Man
Posts: 214
Joined: Sun Apr 01, 2007 2:10 pm

Post by CKY-2K/Clay Man »

Ah, thanks, that clears up alot.
I was mostly talking about NES but thanks for the other info.
Because I didn't know exactly how it knows which addresses to grab values from to put into the registers.
Image
Here to at least get an idea of how the NES works. I mean I know alot of the basic things, but this place'll help me grasp more how NES functions.
Major respect to NES developers.
Post Reply