Is the Z80 'Game Boy' CPU 8 or 16 bits?
Asked Answered
G

1

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?

Grallatorial answered 8/9, 2013 at 19:19 Comment(4)
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.Mazarin
Interestingly the z80 apparently had a 4 bit alu... osnews.com/story/27309/…Risinger
@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: archive.computerhistory.org/resources/access/text/Oral_History/…Bortman
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.Lauzon
S
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.

Sotted answered 8/10, 2014 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.