Question About Absolute Addressing
-
CitizenSnips
- Posts: 11
- Joined: 08 Jan 2017
Question About Absolute Addressing
I'm currently writing a VHDL 6502 core for an FPGA. I'm trying to stay as true to the original microarchitecture as possible in my design, and have been using this block diagram to do so. I'm currently working on the control logic for implementing absolute addressing. I have PCL, PCH, ABL, and ABH registers, as shown in the block diagram. However, I'm unsure as to how I should "save" the lower byte of the effective address used in absolute addressing. I can't hold it in ABL, since I need to load that with the incremented value of PC to retrieve the upper byte of the effective address on the next cycle. I could simply create another intermediate register to hold the lower byte, but I'm wondering how the original 6502 handled this issue before I go changing the microarchitecture, as I'm not gleaning anything from looking at the block diagram. Anyone here know?
Re: Question About Absolute Addressing
It's often useful to look at some traces in visual6502.
Here we see that the LSB (the first operand byte) passes through the ALU:
http://www.visual6502.org/JSSim/expert. ... 22ad1122ea
So there's your answer - values can take a trip through the ALU to be safe for a cycle.
Edit: I couldn't get to your image link, but I assume you're using Donald Hanson's block diagram.
http://visual6502.org/wiki/index.php?ti ... ck_Diagram
Here we see that the LSB (the first operand byte) passes through the ALU:
http://www.visual6502.org/JSSim/expert. ... 22ad1122ea
So there's your answer - values can take a trip through the ALU to be safe for a cycle.
Edit: I couldn't get to your image link, but I assume you're using Donald Hanson's block diagram.
http://visual6502.org/wiki/index.php?ti ... ck_Diagram
Last edited by BigEd on Tue Feb 28, 2017 9:01 pm, edited 1 time in total.
- GARTHWILSON
- Forum Moderator
- Posts: 8774
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Question About Absolute Addressing
I don't know the answer; but although tedious, it may be helpful to see how others have done it:
- links to 19 free HDL 65xx cores http://6502.org/homebuilt#HDL
- comparison of many HDL 6502 cores available (forum topic, with links) viewtopic.php?f=10&t=1673
- BMOW tiny 6502-like CPU in CPLD http://www.bigmessowires.com/cpu-in-a-cpld/
- links to more help understanding the innards of the 6502 at the gate and transistor level viewtopic.php?p=48951#p48951
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Question About Absolute Addressing
Thanks Garth - extra pointers always helpful!
-
CitizenSnips
- Posts: 11
- Joined: 08 Jan 2017
Re: Question About Absolute Addressing
Thanks very much, both of you!
Re: Question About Absolute Addressing
Good luck with your project - do post updates as you make progress!
Re: Question About Absolute Addressing
CitizenSnips wrote:
I'm trying to stay as true to the original microarchitecture as possible in my design, and have been using this block diagram to do so.
If you haven't already, you should consider the bidirectional nature of the two sets of pass MOSFET's. An actual 6502 exploits the MOSFET's ability to pass a signal in either direction (as can be seen if you explore various visual6502 simulations).
Directly implemented in silicon, the pass transistors are a shortcut that simplifies the design. Unfortunately that's not the case in the FPGA context. This isn't intended to discourage you. I'm just pointing out that using the original 6502 as your roadmap may drastically complicate matters, contrary to what one might expect.
AFAIK only one of the 19 cores in Garth's list models the pass transistors; all the other cores use unidirectional signal paths, which of course map much more easily to FPGA. The exception is Andrew Holme's core, which he describes here and which is the subject of this forum thread.
(BTW, CitizenSnips, it's not necessary to use third-party sites for posting images. On this forum you have the option of including images as attachements to your post.
cheers,
Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: Question About Absolute Addressing
Dr Jefyll wrote:
... (BTW, CitizenSnips, it's not necessary to use third-party sites for posting images. On this forum you have the option of including images as attachements to your post.
)
cheers,
Jeff
cheers,
Jeff
Mike B.