logoalt Hacker News

brucehoult10/13/20243 repliesview on HN

> Can they really be called registers, when they're bytes in DRAM?

Yes they can, because that's just an implementation detail.

Registers are nothing more than a conveniently short address for frequently-accessed working storage. Sometimes they are in their own address space (which in modern use usually doesn't have indirect/computed addressing, but can), but sometimes they are in the same address space as RAM e.g. in AVR the first 32 bytes of RAM are the registers (which might or might not be implemented in the same technology). Some early / small AVRs didn't have any other RAM. The same is true of PIC and 8051. And then there is the TMS9900 where the only on-chip registers were the PC and a pointer to where in RAM the working registers were stored.

It seems entirely appropriate to refer to the 6502's Zero Page as "registers" given that 1) it barely has any others, and 2) the very fundamental for modern software base+offset addressing mode exists only using two zero page bytes as the base. You would otherwise be reduced to using self-modifying code for any access via pointer.

If the 6502 ISA had not become obsolete for other reasons -- the desire for more than 8 bit ALUs and 16 bit addresses -- it is entirely likely that as CPUs became faster than RAM and more transistors were able to be put in the CPU then future 6502s would have brought Zero Page on-chip.


Replies

chrisjj10/13/2024

> It seems entirely appropriate to refer to the 6502's Zero Page as "registers" given that 1) it barely has any others,

Enough to write any program, mind.

> and 2) the very fundamental for modern software base+offset addressing mode exists only using two zero page bytes as the base.

Correction: base indirect + offset.

jdjebdndn10/13/2024

It's not an implementation detail, if it has to go through the system bus

show 2 replies
snvzz10/13/2024

I'd call it scratch page or something of the sort.

The main issue in my mind is that an actual set of registers which are inside the chip do already exist.