6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Apr 28, 2024 5:42 am

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Feb 21, 2010 5:13 am 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
When discussing microprocessors with other people, I would ask general people if they thought one microprocessor was better than another or whether they all do the same thing. A lot of people who don't have an extensive knowledge say that all microprocessors do about the same thing.

I wanted to compare the 6502 family or 65C816 to Microprocessors that we have today. I know that different microprocessors are built differently, have different speeds and capacities.

What I want to avoid is a debate as in "my computer is better". Different chips have different abilities so I wanted to benchmark the 6502 vs different microprocessors in terms of abilities and this discussion is not a speed question.

I wanted to focus and hope to be able to sell the abilities of the 6502 to an audience that has almost forgotten it.


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 21, 2010 6:25 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8147
Location: Midwestern USA
I don't think you can make a valid comparison between the 65xx family and current technology. Compared to, say, an AMD Opteron, the 65C816 is a very simple device with a much smaller memory addressing range, and an eight bit data bus vs. the Opteron's 64 bit data bus and vast memory addressing capabilities.

That said, one of the hallmarks of the 65xx family is its low interrupt latency. This feature tends to make the 65xx very good at handling interrupt-driven I/O, something which can't be claimed for other supposedly more advanced MPUs (e.g., the Motorola 68K family). In fact, the 65xx is several times faster in acknowledging interrupts than the 68K, even when the latter is operated at higher clock rates.

Also, throughput as a function of clock rate (i.e., machine cycle time) is another 65xx strong suit. I'd daresay that if the Opteron was slowed down to the clock rate of a 14 MHz 65C816, you wouldn't see a huge difference in instruction processing time. Of course, the Opteron can read or write eight times as much data per bus cycle as the 65C816, but we'll ignore that little difference for now. :)

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 21, 2010 7:59 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
A few older topics where this was discussed:
viewtopic.php?t=784
viewtopic.php?t=737
viewtopic.php?t=18 (about 1/3 of the way down the first page, it bacame a discussion on comparing processors)

The 6502 has excellent performance for a processor that doesn't require you to be a computer scientist to design with it. Its interrupt performance is particularly outstanding. Plenty of other things are discussed at the topics linked above.


Last edited by GARTHWILSON on Mon Apr 26, 2010 4:42 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 21, 2010 9:30 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
ChuckT wrote:
I wanted to focus and hope to be able to sell the abilities of the 6502 to an audience that has almost forgotten it.

I have read BDD's and Garth's comment about interrupt latency and the good instruction/cycle ratio and had a quick glance at the links provided. But the only thing that made the 6502 famous in an instant was its price. AFAIK it was offered for $25 while the 8080 and 6800 should cost around $180. I don't know about the Z80 but I bet its price wasn't much better otherwise Intel and Motorola would have adjusted their prices (as they did when they noticed the price of the 6502).

If you can buy a reasonably good car for $xxxx or you have to pay at least six times as much for a slightly better one, I am quite sure that I know which one you will buy.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 21, 2010 5:29 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Indeed, the 6502 offers virtually nothing of value to contemporary applications, except for its interrupt latency.

Contemporary Z80 processors now have (close to) single-cycle execution rates, thus eliminating the 6502's performance advantage over the Z80.

The 6800-series of CPUs offers a far richer instruction set and more useful addressing modes, particularly for compiled languages.

The 8080/Z80 family offer a larger number of internal registers, distinct I/O and memory address spaces.

The 68000...well...not much of a comparison here. 32-bit wide registers, of which there are 16. Poor interrupt latency, but if that's OK for your application, you're essentially working with a mainframe-class CPU here.

The ColdFire, a stepchild of the 68000 family, apparently increases instruction execution rate to RISC speeds. Anyone have any knowledge about its interrupt latency?

Pretty much ANY RISC architecture you can think of will have the 6502 beat in terms of instruction execution rate, address space available, and instruction simplicity. Writing a compiler to take advantage of the 65816's addressing modes is even more difficult than it was taking advantage of segmentation for the 8086.

And speaking of which, the 80x86 architecture, while one of the smallest CPU market penetrations in the world, is the most relevant, since it's on literally everyone's desktop, and in most servers these days. Combined with embedded Linux distributions, you can expect the popularity of x86 architectures to grow quickly as the years go on.

The 65C02/65C816 no longer offer any power consumption advantages either; compared to the latest ARM processors, 65xx consumes about twice the power for about 1/10th the operating frequency.

Right now, I think the only appeal for using the 6502/65816 exists for system-on-a-chip designs. The only outward-facing appeals for hobbyists are interrupt latency and its bus simplicity. No other CPU on the market today, to my knowledge, has as easy-to-use a bus as the 6502 for low bus speeds (the 65816 somewhat approaches the 8088 in complexity, due to its address/data multiplexing). However, the higher the clock speed, the more you become dependent on highly integrated, often programmable, logic to properly implement the bus protocol.

And, if anyone with an FPGA at their disposal were so inclined, they could engineer a stack-architecture with approximately double instruction execution performance as the 6502 (for any given clock speed) and which had a single-cycle interrupt response latency with, I'd wager, maybe four weeks worth of coding effort.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 21, 2010 6:13 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
kc5tja wrote:
Indeed, the 6502 offers virtually nothing of value to contemporary applications, except for its interrupt latency.


And, still, cost? It was true - maybe still true - that you could get tiny keyfob photoviewers, with a 6502-based system on chip. Must have been chosen for a reason. I bought a couple (different models) for hacking purposes, but one died and the other wasn't amenable to the exploit script, so I returned them.

It's still as simple a CPU architecture as it used to be, which still makes it cheap to manufacture - if the licensing cost is attractive, it'll still get design wins.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 21, 2010 6:14 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Again -- this is a system-on-a-chip. Your example serves only to prove my point.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 21, 2010 6:18 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Oops - I hadn't read your entire post. I hope that was a rare aberration.

Sorry!


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 21, 2010 6:48 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
ChuckT wrote:
I wanted to focus and hope to be able to sell the abilities of the 6502 to an audience that has almost forgotten it.


Here's a possible angle: It's an engineer's CPU. It's really simple. It's simple to use electrically and it's simple to program: a great vehicle to build a single board computer or to learn machine code programming. You can put your own implementation into an FPGA if you want to experiment with CPU architecture and system-on-chip.

It doesn't help your case much, but also it's historically important: from Apple 1 and successors, various Commodore and Atari machines, through NES and (in a sense) the SNES. Also a crucial influence in the invention of ARM (3.9 billion cores licensed in 2009 - surely the most widely used 32bit architecture?)

Oh, and The Terminator and Bender, but using those examples depends on your audience!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 22, 2010 2:55 am 
Offline

Joined: Sun Sep 15, 2002 10:42 pm
Posts: 214
kc5tja wrote:
Indeed, the 6502 offers virtually nothing of value to contemporary applications, except for its interrupt latency.


The 6502 is still relevant today because it's implementable in a very small number of gates - around 3000 if I remember correctly. The smallest 32-bit processors are around 15k gates.

You can't really talk about "Coldfire's interrupt latency" because there's multiple implementations of Coldfire. There's basically the Coldfire v2, v3, v4, and v5 cores. So it depends on which one you're referencing specifically.

kc5tja]
The ColdFire, a stepchild of the 68000 family, apparently increases instruction execution rate to RISC speeds. Anyone have any knowledge about its interrupt latency?
[/quote]

There's basically four implementations of the Coldfire architecture at this point: v2, v3, v4, and v5. So it's probably more relevant to discuss interrupt latency for a particular implementation.

[/quote="kc5tja wrote:
Writing a compiler to take advantage of the 65816's addressing modes is even more difficult than it was taking advantage of segmentation for the 8086.


I wasn't aware you'd written a compiler backend.

I wrote a 65816 backend for lcc and it wasn't that bad. The 8086 segment registers are much, much worse to deal with than the 65816 addressing modes IMHO.

Toshi


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 22, 2010 3:25 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
I wrote a Forth compiler for the 65816 that emitted native instructions, to experiment with how best to use zero-page resources. I find anything beyond Forth compilers to be utterly intractable.

Concerning segment registers on the 8086, I just can't wrap my head around why people find them so nasty. They're just base address registers (admittedly constrained to objects allocated on 16-byte boundaries, but still...).

They don't take on more sophisticated significance until you enable protected mode, but in effect, they're still just base address registers.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 22, 2010 2:46 pm 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
Quote:
It is important to note that Chuck believes that the worlds first microprocessor is not the much ballyhooed Intel 4004 or 8008, "(I am) not trying to be negative about the guys that did it... they are nothing more than calculator chips". He believes the worlds first real CPU is Tom Bennett's 8bit Motorola 6800 "...it's terrible that guy never got any credit."


http://www.commodore.ca/history/people/ ... peddle.htm

Why did Intel go with Calculator chips instead of real CPU's? How did their design differ from what we are / were using?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 22, 2010 3:40 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Intel targeted calculators (as Commodore did, BTW; Peddle's innovation wasn't the PET, it was convincing Tramiel to let him work on the PET at all) because that's who their clients were -- it was a business case ready-made, with guaranteed customers.

I'm not familiar with the 4004 at all, but to a casual programmer, the 8008 would not look very different from the CPU that kicked off the home computer revolution: the 8080. The instruction set is virtually identical, and all of the registers remained the same. The significant differences were that the 8008 only addressed 16KB of memory, and had an on-chip, 8-deep stack used for subroutines. Contrast this with the 8080, which possessed a 64K address space and an off-chip stack addressed by a dedicated pointer register (SP). The 8080 would go on to provide the base instruction set with which Gary Kildall would write CP/M, which itself would later be cloned into Q-DOS, purchased by Microsoft and rebranded MS-DOS, and wrapped with a GUI we all know and love to hate today as Windows.

Going back on the hardware side, Intel created a barely known descendant called the 8085, virtually identical to the 8080 as far as software is concerned, whose architecture dominated the creation of the 8086, thus giving rise to the much loved-to-be-hated "x86" architecture today. While not binary compatible, assemblers for the 8080 can be written to emit opcodes for the 8086, and yes, that means you can still run 8080 software unchanged on Intel Pentium 4 Xeons today.

The 8008's life purpose, by the way, was not to serve inside calculators, but to serve as the heart of mainframe dumb terminals (hence the 8-bit wide byte, as the IBM S/360 and later models defined their smallest addressible units to use 8-bit bytes! So while IBM created the 8-bit byte, it was Intel who forever immortalized it).

How ironic, then, that Texas Instruments chose the Z80, itself an 8080 spin-off, after all these years, to power their hald-held graphic calculators. Seems somehow appropriate, no? ;)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 22, 2010 3:53 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
A bit of googling suggests the CPU core inside the HP33s and HP35s calculators is 6502-based.

There's also some 'approximate' benchmark numbers:
Quote:
Assuming that all CPUs are clocked at 1 MHz, the QueenBench in Assembly language would produce approximately following results:
- Z80 283 msec
[snip]
- 80188 251 msec
[snip]
- 68000 220 msec
[snip]
- 6502 100 msec
O.T. This was one reason why the 6502 was so popular for chess computers.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 22, 2010 3:57 pm 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
The 6502 is still relevant and useful today in terms of core and licensing cost to large audiences. The keyfob you mentioned and many cheap consumer electronics from China use the 6502 as the core system. Realize that the number of items shipped annually using the 6502 core today is still in the hundreds of millions. That makes it a quite relevant processor today.

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: