Chris
|
Ports and Regsiters
Posted: Wed Jun 30, 1999 7:48 pm
|
What are ports and registers? I know what they are I just don't understand how they work.
I know that all CPUs contain internal registers that are used with specialized functions, such
as the Stack Pointer and the Accumulator. Ports are little communication gates that send
bytes to the hardware, right? Then, what are the purpose of having hardware registers?
For instance, the VDP is read from ports $B3 or $B4 I can't remember. But those ports
are linked to registers. The reason why I ask is because I'm writing a SG1000 emulator
and I would like to understand as much as I can now before I implement and screw things
up. Now, do I have to build a whole VDP structure or VDP variables that handle register
specific information and stuff? I want to know do I implement these registers the same
way as I did with the Z80 core.
Chris :o)
|
- Joined: 29 Jun 1999
- Posts: 254
- Location: California, USA; Hiroshima, Japan
|
Read this before you read my reply above... *text*
Posted: Thu Jul 01, 1999 12:31 am
|
Quote > What are ports and registers? I know what they are I just don't understand how they work.
I think you're right about the ports, so I won't bother to explain that to you.
A register is just an area of memory that contains a certain value, kind of like a hardware-based variable. Most registers can be read from or written to in software, and the information stored in the registers can be processed by the hardware.
PLEASE!!! Correct me if I'm wrong.
Paul
|
CharlesD
|
Re: Read this before you read my reply above... *text*
Posted: Thu Jul 01, 1999 8:21 pm
|
Quote > A register is just an area of memory that contains a certain value, kind of like a hardware-based variable. Most registers can be read from or written to in software, and the information stored in the registers can be processed by the hardware.
> PLEASE!!! Correct me if I'm wrong.
Actually a register is a physical memory location in a processor. All instructions of the processor involve these registers.
Most older processors didn't directly interact with memory, other than to load from and store to. The commodore-64 used to store the registers in memory (I think).
As far as prots go, they are a way for the processor to communicate with other chips. There are two types of ports. Memory mapped and IO mapped. Memory mapped represents the port as a memory location to the processor. IO mapped ports use instructions in the cpu to communicate with chips. The sega geneis is an example of memory mapped ports. The Game Gear and IBM-PC/VGA card are an example of IO mapped ports.
|