The Nintendo Game Boy has RAM called "HRAM" (meaning "high ram")
decoded at locations $ff80
through $fffe
. (All other decoded
locations in the $ffxx
page appear to be I/O device and system
control mappings.)
The CPU also has a special "high page" load instruction that works
like the 6800/6502 zero page or 6809 direct page addressing modes.
This apparently uses mnemonic LDH
("load from high
page") and the opcode is follwed by only the low byte of the address;
the high byte $ff
is implicitly assumed (i.e., LDH A,$a0
loads
from $ffa0
). This makes it one byte shorter (and thus faster to read
and execute) than a standard direct address LD
load instruction.
My questions related to this are:
Where is this HRAM, physically? Is it on the CPU die? Outside of the clock cycles saved by the new high-page instructions, is it any faster than any other RAM? Does it have any other special properties? (E.g., there seems to be a DMA system which when running blocks access to external RAM and ROM but not HRAM. I don't know if the DMA system can itself access HRAM.)
When HRAM is accessed, what appears on the external address/data/control buses and cartridge port? Bonus points if you have further interesting information about this when accessing other parts of the high page.
What's the full list of additional instructions/addressing modes added to the CPU that relate to HRAM and/or high-page access? Do any other 8080-like CPUs provide this, or is this unique to the Sharp LR35902? What assemblers understand extra mnemonics like
LDH
? Do any assemblers automatically choose the shorter addressing mode when assembling instructions likeLD A,$ff80
?The boot ROM sets up the stack in HRAM (the first instruction is
LD SP,$fffe
). What's the advantage of doing this over just putting the stack in regular work RAM?What are typical uses of HRAM, if any, that use its special characteristics beyond just "I saved a byte on a load or store instruction"?
If you feel any of these questions are big enough to warrant being extracted to a separate question on this site, mention this in your answer or a comment and I'll look at doing that.