Reply to post: Re: GPS is not this day and age

Fun fact: GPS uses 10 bits to store the week. That means it runs out... oh heck – April 6, 2019

Anonymous Coward
Anonymous Coward

Re: GPS is not this day and age

"Zilog Z80 chip it ran on was the processor for all sorts of much more serious machines. And it is true to say that its registers were mostly 16-bit (apart from the 8-bit accumulator used for arithmetic...)."

Sort of - the 6 general purpose 8 bit registers B+C, D+E, H+L (and their counterparts B'+C', D'+E', H'+L') can be used in those pairs as 16 bit addressing registers.

Commands such as ADD HL, BC treat the HL register pair as a 16 bit accumulator: add with carry the contents of register pair BC to HL, and place the result in HL (also works on DE and SP).

The two indexing registers IX and IY are 16 bit, as are the program counter and stack pointer (PC and SP). The accumulator and flag registers (and their A' and F' counterparts) were 8 bit. It has a lot of 16 bit stuff going on inside, does the Z-80, but it's also basically designed around 8 bit data words.

The ADD HL, BC instruction is rather slow: it takes 4 machine cycles (15 T states) according to my ancient "Programming the Z80" book here (Rodney Zaks, 1980, pub. Sybex. The paper is still white and strong, the paperback spine holding together almost as good as new - I'm impressed with that side of it at least). One would assume in any case that the Z80's ALU is not 16 bits wide and I wondered how many bits it operated on. Four, apparently:

<http://www.righto.com/2013/09/the-z-80-has-4-bit-alu-heres-how-it.html>

Every time I read about the details of one of those early 8 bit CPUs, I find out that it was designed by some jolly clever engineers who made apparently strange decisions which nevertheless worked out rather well in practice.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019