6502 can be faster than 68k :-)

Programming the 6502 microprocessor and its relatives in assembly and other languages.
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: 6502 can be faster than 68k :-)

Post by Dr Jefyll »

Quote:
I grabbed my Z80 databook and checked the timing diagrams. A Z80 opcode fetch does two memory reads in two clocks each
Thanks for the correction. My post should have read, "2 or 3 clocks" for a memory cycle. As you say, this results in a tighter bound on the memory speed.
Quote:
Quote:
the Z80 cpu only has a 4-bit ALU !
I hadn't known this, but it explains the "half-carry" flag quite well.
It also explains the Z80's rich set of BCD operations, including multi-digit shifts. A 4-bit ALU suits BCD operations quite nicely!

Incidentally, the 1802 CPU has a one-bit ALU. It performs byte-wise arithmetic and logical operations in bit-serial fashion -- an approach also used by early computers whose registers and/or memory were implemented as shift registers or acoustic delay lines.

-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
TMorita
Posts: 217
Joined: 15 Sep 2002

Re: 6502 can be faster than 68k :-)

Post by TMorita »

datajerk wrote:
yzoer wrote:
Now before this turns into some sort of flame war, if it hasn't already,
Flame war? This has been an academic discussion amongst well respected gentlemen (and ladies?). Everybody will agree here that the 6502 was one of the greatest achievements of the last century, ....
I find the phrase "Every[one|body] will agree..." is fairly consistently a red flag for a weak argument. It is a weak attempt to take one's opinion and elevate it to the level of a group consensus.

There is already a very famous prize given for exceptional accomplishments in the field of science: the Nobel Prize. In the past, they have recognized such notable accomplishments as the discovery of radiation (physics, 1911), discovery of the double helix structure of DNA (medicine, 1962), law of the photoelectric effect (physics, 1922). If you search through the past Nobel Prize awards recipients, you will find that none of the 6502 creators have been awarded the Nobel Prize.

So although the design of the 6502 is reasonably good given its original design limitations, I regret to inform you that it is excessive kc5tja-ish hyperbole to describe it as "one of the greatest achievements of the past century".

Toshi
TMorita
Posts: 217
Joined: 15 Sep 2002

Re: 6502 can be faster than 68k :-)

Post by TMorita »

You guys are comparing a pipelined processor (6502) with microcoded processors (68000, 8088, etc).
This is like comparing apples and oranges.

Yes, pipelined processors are generally faster-per-clock than microcoded processors because there is no internal state ROM which needs to be sequenced. A pipelined processor can load a load/store memory and read/write a register in fewer clocks because it doesn't require a state machine to cycle through all the control line states. This is basic processor architecture stuff covered in Hennessey and Patterson.

Toshi
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: 6502 can be faster than 68k :-)

Post by Dr Jefyll »

<befuddled pause> Gosh, Toshi! your first post (above) sure seems a whole lot less constructive and informative than your second. Anyone can see those guys have gotten a little careless with their statements, but even so....! :shock:
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
Justin
Posts: 32
Joined: 20 Sep 2013

Re: 6502 can be faster than 68k :-)

Post by Justin »

TMorita wrote:
I find the phrase "Every[one|body] will agree..." is fairly consistently a red flag for a weak argument. It is a weak attempt to take one's opinion and elevate it to the level of a group consensus.
I think he was joking. Since everyone here has some special interest in the 6502, of course we're going to think it's great :-)
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Re: 6502 can be faster than 68k :-)

Post by ElEctric_EyE »

Justin wrote:
...I think he was joking. Since everyone here has some special interest in the 6502, of course we're going to think it's great :-)
He wasn't joking. It is possible to make a 6502 in HDL and make it a pipelined or micro-coded version(s). And they will run much faster than the present-day WDC or Rockwell IC's. We have proof of this in 2 FPGA cores. Michael's core is based on micro-code. Arlet's is not.
TMorita
Posts: 217
Joined: 15 Sep 2002

Re: 6502 can be faster than 68k :-)

Post by TMorita »

Justin wrote:
TMorita wrote:
I find the phrase "Every[one|body] will agree..." is fairly consistently a red flag for a weak argument. It is a weak attempt to take one's opinion and elevate it to the level of a group consensus.
I think he was joking. Since everyone here has some special interest in the 6502, of course we're going to think it's great :-)
I find it annoying when people attempt to speak on my behalf by saying "everybody will agree...blah blah". I am part of the "everyone" pronoun, and people should not presume I agree with their viewpoint.

The 6502 is okay given the design contraints, but I don't consider it a great 8-bit processor.
There's other 8-bit processors which have a more symmetric architecture which I consider nicer, such as the 8051, H8/300L, etc.
So not everyone here considers it "great". To me it's merely "okay".

Toshi
TMorita
Posts: 217
Joined: 15 Sep 2002

Re: 6502 can be faster than 68k :-)

Post by TMorita »

I have in front of me "Computer Architecture: A Quantitative Approach". This is the standard textbook used in colleges for teaching basic computer architecture written by Hennessey and Patterson, two of the guys who wrote many of the original RISC papers.

If you look at the index at the back of the book, the section which has numbers looks like this:

...
360 ...
360/85 ...
360/91 ....
370 ...
370/158 ...
370-XA ...
3990 ...
68000 ...
6809 ...
701 ...
7030 ...

So the processor in "Everybody will agree here that the 6502 was one of the greatest achievements of the last century" isn't even mentioned in the standard textbook on computer architecture.
Not even once.

Toshi
User avatar
Arlet
Posts: 2353
Joined: 16 Nov 2010
Location: Gouda, The Netherlands
Contact:

Re: 6502 can be faster than 68k :-)

Post by Arlet »

TMorita wrote:
So the processor in "Everybody will agree here that the 6502 was one of the greatest achievements of the last century" isn't even mentioned in the standard textbook on computer architecture.
Not even once.
Ask yourself what exactly you're trying to accomplish with posts like this. Is there some great injustice in the world because a bunch of hobbyists and enthusiasts have formed an opinion based on their own, maybe limited, experience rather than based on thorough academic study ? Some injustice that needs to be corrected in order to make this world a better place ?

My kids have told me I'm the best dad in the world. Maybe you want to send them a letter explaining that they should read the standard textbook on raising kids, and that my name doesn't even appear in the index.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: 6502 can be faster than 68k :-)

Post by GARTHWILSON »

Strange, since the 6502 has enjoyed possibly the longest product life of any processor, with still today hundreds of millions being produced every year and an estimated 6,000,000,000 in service. I've never heard of some of the others on that list.

A topic we had years ago was "Is there any future of 6502?".
Another: "Why the 6502"

It is not possible for me to get familiar with all the processors to make a totally informed choice of what I think is best for my applications, but I like the fact that the 6502 is very capable on the workbench considering how simple it is. I've used PICs more in recent years but definitely not because of their lousy processor, but rather because of the many onboard peripherals and memory, the many versions available off the shelf from many distributors, and the fact that they can be programmed on the workbench (as opposed to mask-programmed). These things have resulted in very high production volumes, and PICs definitely have a place in history now; but again it's not because of their processors.
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?
datajerk
Posts: 18
Joined: 10 Sep 2012

Re: 6502 can be faster than 68k :-)

Post by datajerk »

Justin wrote:
TMorita wrote:
I find the phrase "Every[one|body] will agree..." is fairly consistently a red flag for a weak argument. It is a weak attempt to take one's opinion and elevate it to the level of a group consensus.
I think he was joking. Since everyone here has some special interest in the 6502, of course we're going to think it's great :-)
Nailed it. This is of course 6502.org, not microprocessor.org.

In the future I will try to refrain from levity. :-)
datajerk
Posts: 18
Joined: 10 Sep 2012

Re: 6502 can be faster than 68k :-)

Post by datajerk »

TMorita wrote:
You guys are comparing a pipelined processor (6502) with microcoded processors (68000, 8088, etc).
This is like comparing apples and oranges.
I'm comparing real benchmarks in real systems, not synthetic benchmarks based on published timings. To me it does not matter if pipelined or microcoded, just what was/is available, the total cost of the system, and it's demonstrated performance. From that context it is completely fair to compare them. That is why I took exception with the OP, it was a synthetic argument without a real workload, and nothing about cost or complexity.
datajerk
Posts: 18
Joined: 10 Sep 2012

Re: 6502 can be faster than 68k :-)

Post by datajerk »

TMorita wrote:
datajerk wrote:
yzoer wrote:
Now before this turns into some sort of flame war, if it hasn't already,
Flame war? This has been an academic discussion amongst well respected gentlemen (and ladies?). Everybody will agree here that the 6502 was one of the greatest achievements of the last century, ....
I find the phrase "Every[one|body] will agree..." is fairly consistently a red flag for a weak argument. It is a weak attempt to take one's opinion and elevate it to the level of a group consensus.
I should have used here instead of here.
Aslak3
Posts: 258
Joined: 05 Aug 2013
Location: Southampton, UK
Contact:

Re: 6502 can be faster than 68k :-)

Post by Aslak3 »

Relative newbie here, in terms of this forum anyway.

First, shouldn't this be in he Hardware sub-forum? ;)

Secondly, isn't this like comparing a bus (yes one with wheels!) with a sports car? Both will get you where you want to go, but both have pros and cons. Saying something is "faster" tells you nearly nothing.

Thirdly, and not trying to start a flame war here; this is a well intended question that I'd like to hear the answer for... I'm curious why the 6502 has endured but (say) the 6809 has not? I have only written code on the 6809 (except for a bit of Z80 back in the day), but I think I would really struggle without 16bit index registers and the (relatively sophisticated) addressing modes. Not to mention the 16bit (dual) stack pointers and relocatable direct page. For the programmer at least it seems clear which one is more pleasant to work with?

I do use MOS peripheral ICs in my 8bit computer though, and consider them to be nice parts. Eg. the 6522 trounces the 6821 in every meaningful way.

In short, why has the 6502 lasted?

Again, no offence is intended. :)
8 bit fun and games: https://www.aslak.net/
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 can be faster than 68k :-)

Post by BigEd »

I think it's often imprinting - The first CPU you get to know well is the one you fixate on. Probably the C64 and the Beeb, the Apple II and the PET have a lot to do with it. Captured in our teens or 20's, we're still here in our ... middle years.

(And the Atari, the NES, ...)
Post Reply