3 ms·
>The Game Boy has eight 8 bit registers: A, B, C, D, E, F, H, and L Why these letters? I'm assuming I, J and K are reserved for specific uses... is G likewise
by samfriedman 8y ago
>The Game Boy has eight 8 bit registers: A, B, C, D, E, F, H, and L
Why these letters? I'm assuming I, J and K are reserved for specific uses... is G likewise?
- bendmorris 8y agoThe H and L registers are special in that they can be used for indirect addressing: some opcodes will combine H (high) and L (low) into a 16-bit number, interpret that as an address and read from that memory location.
- mhink 8y agoIt's less that other letters are reserved, and more that there are only eight general-purpose registers, and four of them already have special meanings. A is the accumulator, F is flags, and as the sibling comment mentioned, H and L represent the high and low bytes of HL, which is the only 16-bit register you can use for indirect memory access in most instructions. It's also used in some control-flow instructions. That leaves four remaining registers, which just so happen to fit perfectly into the remaining space: B, C, D, and E. (They can also be accessed as BC and DE with 16-bit instructions.)