Visual6502 Remix
floooh.github.io
floooh.github.io
Looking at the 6502, I've got to wonder if today's most powerful Place 'n Route tools could make any significant improvement to it.
Edit: Western Design Center manufactures a pin-compatible DIP-packaged 6502. https://www.mouser.com/ProductDetail/Western-Design-Center-W... I couldn't find any pictures or info about what's inside though.
And let's be clear, it was hand routed in both senses of the word. The layout engineers cut the mask by hand, crawling around on the table sized photomask.
Visual 6502 [1] is a transistor-level simulation of the 6502, written in JavaScript. It allows you to investigate how the real hardware behaves in response to some input, and it makes it possible to investigate the circuitry responsible for this behavior. It has proven an invaluable resource in recent years for developers and emulator authors to nail down and document all the weird quirks of their 6502-based hardware. The simulator core is also very useful for modeling other 80’s hardware, such as the NES’s video and audio systems.
Looking at this project’s GitHub [2], it appears this is a rewrite of Visual 6502 that compiles into WebAssembly, resulting in vastly improved performance compared to the original JS implementation.
[0]: https://en.wikipedia.org/wiki/MOS_Technology_6502
The actual simulation is most likely also faster than the original JS implementation, but I haven't measured that. This is done by https://github.com/mist64/perfect6502, which is a rewrite of the original JS simulation code to C. but there's only at most one CPU half-cycle running per 60Hz frame, so the actual CPU performance for the simulation is hard to compare with visual6502.org which I think is running "unthrottled".
[0] https://en.wikipedia.org/wiki/MOS_Technology_6502 [1] https://commons.wikimedia.org/wiki/File:MOS_6502_die.jpg
"Here is the video recording of [this person's] presentation “Reverse Engineering the MOS 6502 CPU” given at 27C3, on the low cost CPU that arguably launched the home computer revolution."
See also: https://fahrplan.events.ccc.de/congress/2010/Fahrplan/events...
LDA #$00 ; A=0
loop:
JSR sub ; call subroutine
JMP loop ; infinite loop
sub:
INX ; increment X register
DEY ; decrement Y register
INC $0F ; increment memory location $0F
SEC ; set carry flag
ADC #$02 ; A += 3 (add 2, with carry)
RTS ; return from subroutineA quick search through GitHub shows that this code is unchanged since the initial commit of the original Visual6502: https://github.com/trebonian/visual6502/blob/4d8da5b680216dc...
I don't think it has any significance except testing a few things like memory read/write access, whether the stack works etc...
Here's an extremely well commented disassembly of Super Mario Bros.