stepping machanism of Apple Disk ][ drive (was Re: Heatkit 51/4 floppies)

From: Richard Erlacher <edick_at_idcomm.com>
Date: Sun Apr 11 13:18:12 1999

If you look at the instructions as opposed to getting too hung up on the
register assets, and simply look at what it takes to "do something" e.g.
load a value, do some arithmetic, store a value, etc. the two instruction
sets have considerable overlap. However, the longest instructions for the
6502 take six (?) clock ticks, while the shortest ones for the Z-80 take
four. (feel free to correct me, as I haven't even though about this, let
alone looked at precise instruction details for over ten years.) I don't
know how long the longest instruction for the Z-80 takes nor do I even know
what its longest instruction is. I'd imagine it's one in which you load a
16-bit register from memory, indexed, or some such. That would have to take
a fair number of clock ticks.

In my comparisons, I've always fudged in favor of the Z-80, because it
didn't make sense to me that a processor so cheap and simple would be as
much faster than a Z-80 as the 6502 appeared. The hardware problems aside,
the Z-80 instruction set is full of pretty complex instructions which take a
number of clock ticks. The 6502 is full of fairly complex instructions too,
but not as many. Fortunately, most programmers don't use ALL of either
processor's instructions unless they are pushed. If you look at a simple
load-the-accumulator then store-the-result, which occurs often in almost any
application, the Z-80 takes about 6 ticks in the opcode fetch/decode (the
instruction is decoded during the refresh cycle), three for each byte of the
source address, then three to fetch the value. It then takes as long to
store the result to memory. That's 6+3+3+3=15, twice is 30 ticks, or 7.5
microseconds at 4MHz. The 6502 takes one to fetch the load opcode, one to
fetch each byte of the source address, one to execute the load, one to fetch
the store opcode, one for each byte of the destination address, and one to
accomplish the store. That's 5 to load, 5 to store, which is 10, right? It
would appear that the 6502 would get through this pretty quickly at the same
clock rate, i.e. 2.5 microseconds, but the problem is that external
peripheral devices wouldn't run this fast. What's more, the 4 MHz parts,
though priced a little higher than a 4 MHz Z-80, in 1980, the Z-80 had
peripherals which would work very well together with the CPU at 4 MHz.
Nevertheless, that's a 3:1 performance ratio which, based on the fact that
there were many more register-to-register (quick) operations available to
the Z-80 programmer, it's hard to imagine these would close the gap that
much. They would have a significant impact, though.

I think you can easily build a circuit with a 2 MHz 6502 and one with a 4
MHz Z-80 and make a comparison yourself. If you honestly try to take
advantage of the instruction set to accomplish a task on both processors,
you'll play HELL getting the Z-80 to keep up. It can be done, though, if
the task is chosen properly. A pair of simulators would be really handy,
wouldn't it?

Dick
-----Original Message-----
From: Pete Turnbull <pete_at_dunnington.u-net.com>
To: Discussion re-collecting of classic computers
<classiccmp_at_u.washington.edu>
Date: Sunday, April 11, 1999 10:55 AM
Subject: Re: stepping machanism of Apple Disk ][ drive (was Re: Heatkit 51/4
floppies)


>On Apr 11, 10:20, Richard Erlacher wrote:
>> Subject: Re: stepping machanism of Apple Disk ][ drive (was Re: Heatkit
>51
>> I have to disagree with your comparison of the 2 MHz 6502 with a 4 MHz
>> Z-80A. My thought here is that the 4MHz Z-80 used in the conventional
>way,
>> had a memory cycle of 750 nanoseconds (3 clock ticks), while the 6502, at
>> whatever rate, again, used in the conventional way, had a memory cycle of
>> one clock tick. Now, some instructions involve several memory cycles,
>but
>> that was true of both processor families. What I often cursed, was that
>the
>> textbook application of the 650x core left memory available (idle) half
>the
>> time. That was a blessing up to a point (2.5 MHz to be exact) because it
>> allowed for DRAM "RAS-precharge." The Apple and others like it proved
>that
>> at around 1 MHz, the 6502's memory could be used for an entirely separate
>> purpose, e.g. video refresh.
>
>I wasn't talking about precisely 2MHz vs 4MHz, just a ballpark figure (as
>opposed to "about the same" or "about ten times" clock speeds). So, given
>the rest of your message, I think we're in broad agreement. BTW, BBC
>Micros have a 2MHz clock on the 6502, and interleaved video and processor
>access quite happily in 1980. The video took care of the refresh
>requirement.
>
>> I believe there are entirely too many subjective, architecture-related,
>> factors to allow an absolute comparison/contrast of the two processors.
>
>Agreed :-) That's why lies, damned lies, and benchmarks are so much fun
>:-)
>
>> In my "gut" I still believe the 4 MHz Z-80 is about
>> comparable to a 1.5 MHz 6502.
>
>Well, that's not very far from what I wrote, is it? I was just pointing
>out that although Allison seemed to imply that a 6 or 8MHz Z80 was much
>faster than a 4MHz(? I haven't got the original message any more) 6502, I
>believe that to be far from the case.
>
>--
>
>Pete Peter Turnbull
> Dept. of Computer Science
> University of York
Received on Sun Apr 11 1999 - 13:18:12 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:31:41 BST