Comment by ๐ stack
Re: "[https link] Animated 6502 Block Diagram (http link) run aโฆ"
Great. My favorite CPU. Nothing is as fun to write assembly for. Is it your project?
I remember reading about some kind of inaccuracies in the block diagram... Is this one corrected?
2025-12-13 ยท 5 months ago
2 Later Comments โ
๐ฅฌ lamb-duh [OP] ยท Dec 13 at 15:25:
My favourite CPU too :) It was the first ISA I wrote assembly for, and still the only one where I've written more than bits of glue for C.
Yes, the project is mine, although my contribution is really just bringing a bunch of amazing work by different people together. Check out the "about" tab on the page to see who did all the real work.
I did do some work to "fix" the block diagram but it's possible that there are still some issues with it. I don't really know the internal architecture, I made this tool to help me learn too. The changes I made to the block diagram were made during testing when I found behaviour in the perfect6502 simulation that was incorrect on the block diagram.
The only major change I made to the diagram was showing the stack register as two seperate "boxes". This came up because I noticed that the stack pointer was behaving inconsisntly with how the diagram was labeled, it was acting like an edge-triggered register rather than a level-triggered latch (like every other "box" on the diagram). I was able to find the other half in the 6502 transistor network, and it made the diagram update those "boxes" when it said it was.
I tested every legal instruction manually. It's very possible that I missed some things, but I fixed all of the bugs I found. I'm very confident that the Hanson diagram is a very faithful representation of the internal architecture. There is another well known block diagram of the 6502 that is published in a datasheet. That one is known to be incorrect and incomplete. That diagram should be avoided by anyone who wants to learn about the internal architecture.
๐ stack ยท Dec 13 at 15:37:
Thank you. I've been itching to do something 6502-related lately...
Original Post
[https link] Animated 6502 Block Diagram (http link) run a transistor-level simulation of the MOS Technology 6502 and shows the internal state on Donald Hanson's Block Diagram. Runs in a (modern) webbrowser. [https link] source code (github) If you want to see it run ehbasic, press the run button and switch to the I/O tab. Type "c4000" into the text box, press enter, and then unfocus the texbox. This will send the input needed to get you to READY. Give it some time, it is slow. Type your...