Hacker News new | past | comments | ask | show | jobs | submit login

> and not a whole lot of memory space to boot as it had 16-bit wide registers.

If only. Its program counter is 16 bits, but the other registers are 8 bits.

> It would be hammering external memory like crazy.

For some 6502s, like crazier. The NMOS 6502 has a ‘feature’ called ‘phantom reads’ where it will read memory more often than required.

https://www.bigmessowires.com/2022/10/23/nmos-6502-phantom-r...:

“On the 65C02, STA (indirect),Y requires five clock cycles to execute: two cycles to fetch the opcode and operand, two cycles to read two bytes in the 16-bit pointer, and one cycle to perform the write to the calculated address including the Y offset. All good. But for the NMOS 6502 the same instruction requires six clock cycles. During the extra clock cycle, which occurs after reading the 16-bit pointer but before doing the write, the CPU performs a useless and supposedly-harmless read from the unadjusted pointer address: $CFF8. This is simply a side-effect of how the CPU works, an implementation detail footnote, because this older version of the 6502 can’t read the pointer and apply the Y offset all in a single clock cycle.”

I don’t know whether it’s true, but https://www.applefritter.com/content/w65c02s-6502 (Comment 8) claims:

“The Woz machine on the Disk II card is controlled by the address lines (which set its mode) and exploits this "phantom read" to switch from SHIFT to LOAD mode during floppy disk write operations so in the CPU cycle immediately following the phantom read, which is the write cycle, to the same address as the phantom read (assuming no page crossing this time), the Woz machine will be in LOAD mode and grab the disk byte ("nibble") from the 6502 data bus. The Woz machine does a blind grab of that byte, it does not look at the R/W signal to determine if it's a write cycle. If the phantom read is missing, it just won't work because the data byte will be gone before the mode changes to LOAD.

I am quite sure that this is how the Disk II works. But this is where my own hands-on experience ends.”




> If only. Its program counter is 16 bits, but the other registers are 8 bits.

Oh wow, I didn't remember that. I had to go back to double check it! Maybe the NES had wider registers? Or maybe I'm just completely misremembering, which is definitely probably absolutely the case.

Also, thanks for all the other links! Really interesting stuff.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: