12 ms·
The MOS 6502 and the Best Layout Guy in the World
- commandar 16y ago>The most amazing part about the whole process is that they got the 6502 right in one try. Quoting On the Edge: Bil Herd summarizes the situation. “No chip worked the first time,” he states emphatically. “No chip. It took seven or nine revs [revisions], or if someone was real good they would get it in five or six.” In some ways (and I'm speaking in a general sense) situations like that actually make me more nervous than when I know there's a problem. I get this uneasy "there's no way it really went that smoothly" feeling that can be hard to shake. Then again, my personality is to approach most things in life iteratively, so that probably plays a part as well. Great read either way.
- rbanffy 16y agoThat's the sensation of working with someone who's incredibly good. And, BTW, the 6502 was a work of art. Simple, elegant and fast (even at 1 MHz), it ran rings around the Z-80's you found in more expensive computers of the time. Plus, it was delightful to program.
- pvg 16y agoI'm curious why you think so (about the Z80, I mean). I seem to remember it being in very cheap computers as well (ZX Spectrum, doesn't get much cheaper than that) and was a great deal faster. I grew up with a 6502 and love it like a childhood pet but can't see how it 'ran rings' around the Z80.
- jonsen 16y agoI believe the 6502 could do things faster than the Z80. I once implemented the exact same program on a 6800 and a Z80. The 6800 is very close to the 6502. Speed wasn't an issue, but the Z80 version was noticeably bigger. And also felt more quirky to program.
- pvg 16y agoI believe the 6502 could do things faster than the Z80. Right, I was hoping someone might remember specifics. I don't think this is really true, in general. The 6800 is very close to the 6502 Not really.
- forinti 16y agoThe 6502 was faster at accessing memory. I remeber Elite running a lot better on a 2MHz BBC Micro than on any 3.58MHz Z80 based micro, like the MSXs.
- rbanffy 16y agoThe MSX 1 also had a hideous design flaw (for a gaming machine) that hid the framebuffer from the processor. IIRC, you had to do a couple IOs to get a single byte to or from the VRAM.
- wladimir 16y agoI remember the MSX2 had exactly the same flaw, it had a bigger video memory and some 2D acceleration primitives, but the access method was the same, through vpoke/vpeek.
- leoc 16y agoIn his talk http://www.youtube.com/watch?v=HW9AWBFH1sA#t=3m01s http://www.youtube.com/watch?v=HW9AWBFH1sA#t=3m01s Michael Steil claimed that the 6502 had 60% fewer transistors than the Z80 but was twice as fast (in clock terms, I presume), while the Z80 had more registers and allowed slighly denser code.
- mgedmin 16y agoSpecifically, the talk mentions that the 6502 was pipelined and could do many instructions in 2 clock cycles, while the Z80 needed at least 4. This translates to 2x the speed at the same clock rate.
- Flow 16y agoThe 6510(6502 plus IO-ports) could do no such thing. Fastest instructions used 2 cycles and 1 byte op-code.
- rbanffy 16y agoYou use two cycles, but the 6502 could execute the instruction while fetching the next one.
- Flow 16y agoThat's not the pattern I see when looking at the op-code/cycle chart. I recently implemented part of a C64-emulator in JavaScript and it seems very much like every step takes a cycle. For example the instructions NOP(or CLI, STI, INX etc), 1 byte, 2 cycles. 1 cycle for fetching the instruction and one for executing the fetched instruction. LDA addr,x seems to be pipelined a bit though. It's "AD lo hi" in memory and takes 4 cycles unless lo+x > 255, then it takes 5 cycles. The lo+x calculation seems to occur while hi is being read.
- rbanffy 16y agoI will have to dig up my 6502 documentation, but, IIRC, by the time the processor executed the NOP (CLI, INX etc) it already fetched the next instruction, so, if it's another NOP, it will complete in one cycle instead of two. Unless you crossed a page boundary, which implies a one-cycle penalty.
- amichail 16y agoPlus, it was delightful to program. Simple maybe, but not delightful to program. I don't know of any assembly language that is delightful to program. BTW, I knew someone from junior high & high school who could write code for the 6502 using a hex dump with amazing speed. You might have heard of him: Randy Linden.
- jonsen 16y agoStudying the manufacturers data sheet for the chip you could in a short time know everything, and I mean everything, about the instruction set. You would never have any doubt about your programming language. That as least was some form of delight.
- rsc 16y agoWatch the video, especially the second half. There's a lot about the 6502 that wasn't apparent from the data sheet.
- bensummers 16y agoI've written a lot of ARM assembler, and I think that could be described as a delight to program. An orthogonal instruction set, consistent naming, conditionals on every instruction, and a decent number of registers make it really quite pleasant (as these things go). These days I'm writing a lot of code in Ruby and JavaScript on the JVM, and find myself considering Java my current equivalent of assembly. It's sad really, being so far away from what the CPU is actually executing.
- sfphotoarts 16y agoI found the z80 delightful to work with, especially in comparison with the 6502 because it had twice as many registers and you could switch banks of them on the z80. you have to love programming to really appreciate assembly, the succinctness, the satisfaction of being so close to the metal, none of this high level peek and poke nonsense of high level languages :) you don't write code using a hex dump??? You write assembly code using either hand assembly or more efficiently using a tool called an assembler which makes the tedious task of mapping instructions by name to their hex values easier. After a while you get to remember the common ones though, C9 for example. And I haven't heard of your school buddy, sorry.
- eru 16y agoThe CCC congress yielded some great talks this year.
- mmphosis 16y agoIntel Core 2 - Yorkfield, 45 nm process technology, Number of Transistors: 820 Million MOS 6502, Number of Transistors: 3510 So in theory, a chip with 65536 MOS 6502 cores each with 64K of internal RAM (4Mb cache) could be made.
- meastham 16y agoSure, if you completely ignore all of the extra circuitry for the on-chip network and cache coherency and everything else you would need. Transistor density is far from the limiting factor in the number of cores we can wedge into a single system.
- jdeeny 16y agoIf you assume that there is no cache (only on-die memory) and that memory is not shared between cores, things become much simpler and scale more linearly. Core-to-core communications and plenty of other details remain to spend man-years ironing out, but it seems like it would be possible to approach 64k cores or at least 16k.
- RodgerTheGreat 16y agoMight be able to peel out the BCD stuff from the 6502 to free up a little additional space and approach communication between cores kinda like the "handshake bus" GreenArrays chips use: http://greenarraychips.com/home/documents/greg/PB003-100822-F18A.pdf http://greenarraychips.com/home/documents/greg/PB003-100822-...
- VMG 16y agoHere it is in all its javascript goodness: http://www.visual6502.org/JSSim/index.html http://www.visual6502.org/JSSim/index.html
- deleted 16y ago[deleted]
- exception 16y agoI loved the 6502. Around that era I programmed the SC/MP, Z80, the 8080 and the 6800. Although the Z80 was more powerful, the 6502 holds a special place in my heart as it was the first CPU I worked with and I loved the simplicity of the instruction set. My crowning achievement was a multi-threaded kernel for a CNC punch. Since the stack was at a fixed memory address and there was no PUSHA, I had to change threads (in response to an IRQ) by sequentially pushing the registers on to the stack and then swapping the stack with a block copy. It worked! Crazy :/ I loved reading this article - thanks for posting. Awesome stuff! Makes me want to code my own circuit emulator :)
- thinkingeric 16y agoDitto that. My first programs were in assembly on the 6502, and I'm thrilled to see it getting this attention. I'm just sorry that I don't still have the KIM-1.
- greggraham 16y agoI was planning on buying a KIM-1 when my dad surprised me by buying an Apple II. I didn't end up writing anything in assembly on the Apple II, though. My first assembly language was IBM-370 in college. I wish now I had started with the KIM-1, though.
- wallflower 16y agoFrom Jordan Mechner's diary of the development of Prince of Persia (POP was originally coded in 6502 Assembler. It took him four years). Reading Jordan's full diary will take you at least eight hours but it is well worth it. > We chatted for an hour about peripherally related topics. Broderbund, corporate America, the rat race, capitalism, freedom. I was seducing him. At the critical psychological moment, I remarked: "You know, all my clipping is done on the byte boundaries." There was a pause http://jordanmechner.com/old-journals/page/33/ http://jordanmechner.com/old-journals/page/33/ April 3, 1989
- Luyt 16y agoThe whole 'Reverse Engineering the 6502' talk Michael Steil gave at CCC congress is on YouTube. I posted this earlier in a separate topic, but it didn't pick up. Clickable links to the 6 parts: http://www.youtube.com/watch?v=HW9AWBFH1sA http://www.youtube.com/watch?v=HW9AWBFH1sA http://www.youtube.com/watch?v=bBE4KHKzhKc http://www.youtube.com/watch?v=bBE4KHKzhKc http://www.youtube.com/watch?v=tRBo7O_blVo http://www.youtube.com/watch?v=tRBo7O_blVo http://www.youtube.com/watch?v=H_15RtVbqGU http://www.youtube.com/watch?v=H_15RtVbqGU http://www.youtube.com/watch?v=N9DYmlprCKA http://www.youtube.com/watch?v=N9DYmlprCKA http://www.youtube.com/watch?v=eZOUuqc4pk8 http://www.youtube.com/watch?v=eZOUuqc4pk8