9

I was reading a tutorial about creating a Game Boy emulator, I understand that the Game Boy uses an 8-bit CPU, but I can't understand why the Gameboy uses two types of data: bytes (8 bits) and words (16 bits).

If the CPU has a capacity of 8 bits, why it is possible to use 16 bits?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Toni
  • 95
  • 6
  • 13
    The Z80 has an 8 bit data bus, a 16 bit address bus, and the ALU can perform 8 bit and some 16 bit operations. It's generally considered to be an 8 bit CPU. – Paul R Sep 08 '13 at 19:27
  • 3
    Interestingly the z80 apparently had a 4 bit alu... http://www.osnews.com/story/27309/The_Z-80_has_a_4-bit_ALU_-_here_s_how_it_works – old_timer Sep 09 '13 at 17:53
  • @dwelch it definitely did, yes — a primary source to confirm that is Masatoshi Shima's comments starting at the bottom of Page 9 of this Computer History Museum Zilog panel discussion: http://archive.computerhistory.org/resources/access/text/Oral_History/102658073.05.01.acc.pdf – Tommy Dec 17 '13 at 22:28
  • 1
    Z80 can perform some math operations on 16 bits registers (HL, BC, DE, SP, IX, IY), has a 16 bits accumulator (HL) besides the usual 8 bits (A), and can access the memory in blocks of 16 bits (such as LD HL, (0x1234). In my opinion is an hybrid 8/16 bits CPU (at least from the programmer point of view), in the same way the Motorola 68k is a 16/32 bits cpu. Of course the 16 bits instruction set is very limited, but if it was complete, the Z80 would be a full 16 bits CPU. That's a very controversial opinion of mine, I admit. – André Baptista Dec 28 '22 at 12:58

1 Answers1

9

The CPU and registers are 8 bit, but it can store and use 16-bit data by grouping two registers as if they were one 16-bit register. This website has some great information about the Gameboy's hardware.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
isaac tschampl
  • 388
  • 2
  • 12