Compare the Z80 with the 6502...
Re: Compare the Z80 with the 6502...
MichaelM wrote:
It would be like agreeing that the x86 base architecture is the best because it won the processor wars.
-
Benoit0123
- Posts: 25
- Joined: 28 Sep 2012
- Location: Boulogne Billancourt, France
- Contact:
Re: Compare the Z80 with the 6502...
<disgress>AFAIK, Intel did not win the mobile application processor war if we count by numbers instead of by revenue. By numbers of deployed units, ARM and all it licensees are leading the way by a factor of ten or more</disgress>.
One thing the Intel designers did wrong was the CPU frequency race they forced us to arbitrate (Intel, AMD, Citrix an dso on...) in the last ten years.. hopefully they fall back to designing multi-core architectures just before hitting the wall of reality physics for serving more usage oriented needs (multi-applications).
One thing the Intel designers did wrong was the CPU frequency race they forced us to arbitrate (Intel, AMD, Citrix an dso on...) in the last ten years.. hopefully they fall back to designing multi-core architectures just before hitting the wall of reality physics for serving more usage oriented needs (multi-applications).
Re: Compare the Z80 with the 6502...
Sure, Intel has not won the mobile war, because there weren't really competing in it. They have been competing in the high performance, general computing, war, and have solidly beaten everybody else. Also, ARM is in a completely different business, because they're selling IP, while Intel is selling chips.
-
Benoit0123
- Posts: 25
- Joined: 28 Sep 2012
- Location: Boulogne Billancourt, France
- Contact:
Re: Compare the Z80 with the 6502...
Quote:
Sure, Intel has not won the mobile war, because there weren't really competing in it
Quote:
Also, ARM is in a completely different business, because they're selling IP, while Intel is selling chips.
OT: the zx80
Off topic, but back to hard tech:
Grant Searle has posted some nice scope photos illustrating the zx80 display scheme - this design makes use of the z80 in a very cunning way:
http://searle.hostei.com/grant/zx80/zx80ScopePics.html
The photos are also excellent illustrations of bus activity generally.
I was originally wondering about the very small RAM in Sinclair's machines: lo and behold, they are of course SRAM, for the low chip count. I had somehow imagined that the Z80 offers a multiplexed address bus, but of course that wouldn't work well for ROM or peripherals.
Cheers,
Ed
Grant Searle has posted some nice scope photos illustrating the zx80 display scheme - this design makes use of the z80 in a very cunning way:
http://searle.hostei.com/grant/zx80/zx80ScopePics.html
The photos are also excellent illustrations of bus activity generally.
I was originally wondering about the very small RAM in Sinclair's machines: lo and behold, they are of course SRAM, for the low chip count. I had somehow imagined that the Z80 offers a multiplexed address bus, but of course that wouldn't work well for ROM or peripherals.
Cheers,
Ed
Re: Compare the Z80 with the 6502...
BigEd wrote:
this design makes use of the z80 in a very cunning way
"To display a line of characters the CPU jumps to the start of a line of characters to in the ghost image of it above the 32K boundary to "execute" it. When execution is called above the 32K boundary, hardware intercepts the opcode fetch and the Z80 CPU "sees" a "NOP" instruction on the data bus and executes it." This explains how a Z80 (or 6502) can be tricked into producing a rapidly ascending sequence on its address bus. Part of the memory map (not necessarily above 32K) is a ghost image where the cpu sees NOPs rather than the actual memory data. But the latter gets grabbed by hardware and squirted out as video.
There's another devilishly clever bit that is Z80 specific, as it makes use of the refresh counter. I won't rehash the author's explanation, but it's an optional extra for conserving ram, and isn't fundamental to producing a display. Thanks for the link, Ed!
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Compare the Z80 with the 6502...
Very good point - allow me to link to your take: http://laughtonelectronics.com/arcana/B ... aster.html
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
Re: Compare the Z80 with the 6502...
Nice, I see Dr. Jeff has been working on his website. Looks good, even better than before.
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Compare the Z80 with the 6502...
Quote:
This explains how a Z80 (or 6502) can be tricked into producing a rapidly ascending sequence on its address bus.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Compare the Z80 with the 6502...
Nice observation!
Re: Compare the Z80 with the 6502...
Quote:
E9 E9 (SBC #E9) would be twice as fast at getting through the range of addresses if "rapidly ascending" were super important. SBC# (and several others) take two clocks for a two-byte instruction, so you get an address increment and read with every single clock.
Using a 32-column display as an example, the memory cycles for one scan line (seen from the cpu point-of-view) would be:
- 15 instances of the two-byte, two-cycle instruction C9 C9 (CMP # C9)
- 1 instance of the one-byte instruction $60 (RTS). Luckily the cpu fetches the following byte, too, since we need that final cycle to complete the line. But actually the 6502 always ignores the second fetch of any one-byte instruction. IOW it doesn't matter what the hardware sends to the CPU on that cycle, but probably it's easiest to just send the $60 again. That concludes the scan line. The final 4 cycles of the RTS don't participate because then we're accessing stack, not the special address region that triggers the video shift register, the ghost image and the phantom "nop" instructions.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Compare the Z80 with the 6502...
As the 6502 has the 65816, so the Z80 has the Z180. The approach to addressing more than 64k of memory is interesting, and minimal: nothing changes in the instructions or operands, but instead mappings are applied to two areas in the 64k space. From address 0 to the first area is not mapped, so you get 3 regions in all, conventionally called
- common 0
- bank 1
- common 1
Common 0 is indeed common to all maps - if different mappings are different processes, then they share some lower part of memory space. In the Z80, low memory is for ROMs, vectors and OS, so this is like sharing the top of memory in a 6502 system.
(I don't see that Common 1 is actually common between maps. Also note that common 0 can be empty, with bank 1 starting at address 0)
The granularity is 4k, so only 4 bits are needed to define each of the two boundaries. So there's a single mapping register of 4+4 bits for that. The mapping registers are 8 bits(*), so the physical address gets 12 bits from the logical address, and 8 bits as a result of adding the map to the logical address.
(*) Maybe only 7, but they could have been 8!
The total exposed interface to the MMU then is just 3 8-bit registers: CBAR for the bounds, CBR and BBR for two base addresses.
See http://www.ganssle.com/articles/ammu.htm and http://www.miredespa.com/sb180/HD64180.WS for more. The second of those contains some diagrams such as this:
As we know, the 65816's banking approach gives access to a 24-bit address space. To do the same here would require some adjustment and some more width in the MMU registers.
- common 0
- bank 1
- common 1
Common 0 is indeed common to all maps - if different mappings are different processes, then they share some lower part of memory space. In the Z80, low memory is for ROMs, vectors and OS, so this is like sharing the top of memory in a 6502 system.
(I don't see that Common 1 is actually common between maps. Also note that common 0 can be empty, with bank 1 starting at address 0)
The granularity is 4k, so only 4 bits are needed to define each of the two boundaries. So there's a single mapping register of 4+4 bits for that. The mapping registers are 8 bits(*), so the physical address gets 12 bits from the logical address, and 8 bits as a result of adding the map to the logical address.
(*) Maybe only 7, but they could have been 8!
The total exposed interface to the MMU then is just 3 8-bit registers: CBAR for the bounds, CBR and BBR for two base addresses.
See http://www.ganssle.com/articles/ammu.htm and http://www.miredespa.com/sb180/HD64180.WS for more. The second of those contains some diagrams such as this:
Code: Select all
o BBR (Bank Base Register) specifies high-seven bits
of 19-bit effective address of Bank Area; if
16-bit address is in Bank Area (high 4 bits
>= CBAR low and < CBAR high), then add BBR to
high 4 bits to get high 7-bits of address
16 Bits Total
-------------------------------
Logical Address | High 4 | Lower 12 Bits |
-------------------------------
+ |
----------------- |
BBR | Hi 3 | Low 4 | |
----------------- |
| |
| |
V V
19 Bits Total
--------------------------------------
Physical Address | High 7 Bits | Lower 12 Bits |
--------------------------------------
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Compare the Z80 with the 6502...
BigEd wrote:
As we know, the 65816's banking approach gives access to a 24-bit address space. To do the same here would require some adjustment and some more width in the MMU registers.
Also, the '816 can readily cross bank boundaries by autoincrementing the DB register when the effective address exceeds $xxFFFF, without having to explicitly use a 24 bit address. This capability more or less treats the 24 bit address space as linear RAM for data purposes (but not for programs—PB is not autoincremented when PC wraps back to $0000). It's not clear to me if the Z180 has a comparable capability.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Compare the Z80 with the 6502...
Having read through the thread, I have a few comments:
1) Speaking of cunning, the 6502 is a bit tricky with the cycle counts. I will risk starting a terrible debate by saying that what's referred to as 1 cycle on the 6502 is really 2 internal cycles. The address bus outputs the address, and the memory is read in the same cycle? I would really call this 2 cycles. Don't take it the wrong way, the 6502 is by far my favorite processor.
2) E9 E9 as a fast nop was my slip. More on that subject at pagetable.com
3) 'Fast' command... Back in the 80's I co-wrote a BASIC interpiler(compterpreter?) for the Atari ST (it had a forth-like engine, allowing it to appear interactive while compiling and linking lines of BASIC instantly). Alongside the 'run' command it had a 'fly' command. 'fly' executed the already fast compiled code really fast by turning off all dynamic error-checking, often faster than the C compiler for the ST. If memory serves me right, you could fly some code and switch to 'run' inline.
4) Outside the outright speed comparison... There is something incredibly pleasant about the 6502 instruction set. Even in the midst of a horrible debugging session from hell complete with self-modifying code, I feel really happy working with this chip. Nothing else even comes close. Z80 is OK, but 6502 is really nice. It's a zen practice for me, seriously.
Since someone had mentioned the ARM chips, ARM Thumb2 is exactly the opposite of the 6502. It's just disgusting to write assembly for the Thumb2, and writing any kind of a compiler, even a simple native Forth code generator, is a painful, stressful experience. Many people mentione the ARM as some kind of 6502 descendant, but I really have to object. There is nothing about the arm that looks to me like a feature inspired by the 6502.
1) Speaking of cunning, the 6502 is a bit tricky with the cycle counts. I will risk starting a terrible debate by saying that what's referred to as 1 cycle on the 6502 is really 2 internal cycles. The address bus outputs the address, and the memory is read in the same cycle? I would really call this 2 cycles. Don't take it the wrong way, the 6502 is by far my favorite processor.
2) E9 E9 as a fast nop was my slip. More on that subject at pagetable.com
3) 'Fast' command... Back in the 80's I co-wrote a BASIC interpiler(compterpreter?) for the Atari ST (it had a forth-like engine, allowing it to appear interactive while compiling and linking lines of BASIC instantly). Alongside the 'run' command it had a 'fly' command. 'fly' executed the already fast compiled code really fast by turning off all dynamic error-checking, often faster than the C compiler for the ST. If memory serves me right, you could fly some code and switch to 'run' inline.
4) Outside the outright speed comparison... There is something incredibly pleasant about the 6502 instruction set. Even in the midst of a horrible debugging session from hell complete with self-modifying code, I feel really happy working with this chip. Nothing else even comes close. Z80 is OK, but 6502 is really nice. It's a zen practice for me, seriously.
Since someone had mentioned the ARM chips, ARM Thumb2 is exactly the opposite of the 6502. It's just disgusting to write assembly for the Thumb2, and writing any kind of a compiler, even a simple native Forth code generator, is a painful, stressful experience. Many people mentione the ARM as some kind of 6502 descendant, but I really have to object. There is nothing about the arm that looks to me like a feature inspired by the 6502.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
-
leeeeee
- In Memoriam
- Posts: 347
- Joined: 30 Aug 2002
- Location: UK
- Contact:
Re: Compare the Z80 with the 6502...
Quote:
The address bus outputs the address, and the memory is read in the same cycle?
Quote:
I would really call this 2 cycles.
Lee.