6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 9:01 am

All times are UTC




Post new topic Reply to topic  [ 59 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: The 65C816 is yucky!
PostPosted: Fri Sep 25, 2015 6:50 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
Over in another topic, discussion has ensued concerning a member's "dislike" of the 65C816. To wit:

    Much of what I dislike about the 65816 stems from the different design choices they made compared to the 68000. Here is a brief list:

    • 8-bit data bus (vs. 16-bits for 68000)
    • Small register file and lack of general purpose registers
    • Segmented memory architecture (ala x86)
    • Lack of prioritized interrupts

    However, I'm sure you're right that there are some good things about it that I may not be aware of not having used it much. For one, I believe it's more efficient than the 68000 in terms of clock cycles, though back in the day you couldn't get a 65816 that could be clocked nearly as fast as a 68000. And I suppose that as an experienced 6502 programmer, it may feel somewhat natural to transition to from the 6502.

A key statement in the above is However, I'm sure you're right that there are some good things about it that I may not be aware of not having used it much. Having read this, a childhood experience immediately comes to mind, a time when broccoli was served with dinner:

    "I don't like broccoli. It's yucky!"

    "How do you know that it's yucky if you haven't eaten it?"

How would one know to like or dislike a microprocessor if one, by one's own admission, has not had any experience with it?

Now, it's not my intention to shame, cajole or otherwise exhort anyone to design their next computing device around a 65C816—notwithstanding the fact that this is a 6502 forum and the 65C816 is the most advanced and powerful member of the 6502 family. If the Motorola 68K suits one's needs then by all means use it. If one thinks that a Zilog Z80 is the next best thing since sliced bread that's fine as well. If you're into making your microprocessor from a pile of 74-series gates, flops, ALUs, etc., a la the Big Mess O' Wires project, fantastic!

All microprocessors embody design compromises and tradeoffs. In the case of the 65C816, the compromises and tradeoffs had to do with the desire to make it as bus- and software-compatible as possible with other 65xx hardware. The impetus for doing so came directly from Apple Computer—indeed, it could be said that had Apple not developed the under-appreciated IIgs with the ability to run older Apple II software the 65C816 may well have never been born. Hence the 65C816 is the way it is because of the desire to maintain backward compatibility with the 65C02 and predecessors (just as current x86 MPUs carry around 8088 baggage).

As the 65C816 is a compatible form of the 6502, it carries many of the strengths and weaknesses of the 6502. It also introduces capabilities that simply do not exist in the 6502 or 65C02. More capabilities mean there are more aspects to programming the 65C816, such as setting register sizes, relocating the stack, dealing with more interrupt sources, etc. However, considering those aspects in software design is optional, not mandatory. My first iteration of POC ran the 65C816 in emulation mode as I debugged the hardware. Even after permanently switching it to native mode, I continued for a while using the emulation mode software, which worked without changing any code other than hardware vectors.

Relative to other contemporary microprocessor designs, e.g., the aforementioned 68K, the 65C816's performance when measured in terms of throughput at any given clock rate is comparable and in some cases, better. The 68K, for example, has a complicated interrupt response behavior and thus suffers from significant interrupt latency. My experiences with the 68K-powered minicomputers that dominated much of the 1980s bears that out: they all had lackluster I/O performance, an area where interrupts play a big role. On the other hand, the 68K's surfeit of general purpose registers and generally orthogonal programming model makes it quite efficient at compute-bound tasks. However, at identical clock speeds, the 65C816 will often outperform the 68K in that area unless heavy duty math is involved (no multiply and divide instructions in the 65C816).

I have assembly language programming experience with the 68K, as well as with the 6502 family. However, I prefer the latter, as its assembly language seems to be more conducive to the visualization and solution of problems. So while I don't think the 68K "tastes yucky," I don't think it is as flavorful as the 65C816.

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


Last edited by BigDumbDinosaur on Fri Sep 25, 2015 9:13 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Fri Sep 25, 2015 7:16 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Good idea to start a new thread.


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Fri Sep 25, 2015 9:24 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
First, full disclosure: I hate broccoli. It is beyond me how people can eat that stuff.

Second, a simple practical question: If I want to build a 16-bit machine myself, do I even have a choice? As far as I can tell by checking Mouser, any 68000 that is a modern build is surface-mount, which is doable (or so I am told) for a hobbyist, but not fun. The 8-bitters are holding their own, and we have more 32 bit MPUs than we can shake sticks at, but 16 bit CPUs have gotten pretty rare.


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Fri Sep 25, 2015 9:45 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
scotws wrote:
First, full disclosure: I hate broccoli. It is beyond me how people can eat that stuff.

I think the reason so many find broccoli unappetizing is improper preparation. I didn't like it as well until I started cooking for myself and learned how to properly prepare vegetables (hint: you don't boil them). :D Since then, I have added cauliflower and asparagus to the list of veggies that I hated as a child but now eat with regularity.

Quote:
Second, a simple practical question: If I want to build a 16-bit machine myself, do I even have a choice? As far as I can tell by checking Mouser, any 68000 that is a modern build is surface-mount, which is doable (or so I am told) for a hobbyist, but not fun. The 8-bitters are holding their own, and we have more 32 bit MPUs than we can shake sticks at, but 16 bit CPUs have gotten pretty rare.

SOIC type packages with the pins on 50 mil centers are readily soldered with manual techniques, as are QFP style packages. However, manually soldering the latter is not a trivial exercise, as this video illustrates. You need good eyesight, very steady hands and plenty of patience. Homebrew reflow seems to be a more practical process to me. I recently acquired a used but serviceable commercial grade toaster-oven, in which I soon hope to be making an attempt at reflowing parts. The guinea pig will be a POC V1.1 build—if it doesn't work after reflow I'll know I have a mechanical problem with my process.

————————————————————————————
EDIT: In the SMD soldering video linked above, the use of a "Handi-Vac" vacuum placement tool is shown. That tool may be purchased on-line from Edmund Optics for 19 USD plus shipping. You'll want stock number 57-632.

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


Last edited by BigDumbDinosaur on Thu Oct 08, 2015 10:47 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Fri Sep 25, 2015 11:14 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
The latching of a16-a23 seems like the biggest headache of the '816. Although the segmented memory isn't great from a programmer POV, it was a common tradeoff in that era, so it had good company.


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Fri Sep 25, 2015 11:25 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Martin, remember that if a 64K memory map is adequate for your uses, you can forgo the latching, decoding, and use of the bank byte and still get a ton of benefits from the '816. The 65802 did this, and further was pin-compatible with the '02 so you could drop it into circuits made for the '02 and get a lot of new benefits.

I find broccoli quite tolerable BTW, but I can't understand why anyone would put coffee in their mouth. To me, it smells like when you burn the peas in the pan. :lol: On our 30th wedding anniversary last year, the waitress brought us a complementary dessert which had coffee-flavored frosting. I hated it but tried to act grateful for their good gesture. (Or maybe they really did secretly have something against people who had been married 30+ years! :lol: )

_________________
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sat Sep 26, 2015 12:22 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
Martin_H wrote:
The latching of a16-a23 seems like the biggest headache of the '816. Although the segmented memory isn't great from a programmer POV, it was a common tradeoff in that era, so it had good company.

Generating A16-A23 is a hardware matter that has nothing to do with programming, and may be accomplished with discrete logic (74ABT or 74AC recommended if performance matters) or a PLD. However, as Garth pointed out, one need not worry about A16-A23 in order to use the '816. My POC V1 units don't implement A16-A23 and work just fine.

Incidentally, the '816's architecture is not segmented. It's "banked." Those are fundamentally different concepts. Also, the banked architecture is primarily a concern with programs, as PB will not increment when PC wraps. Long indexed addressing can reach out to anywhere in the 16 MB address space without having to deal with DB.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sat Sep 26, 2015 12:24 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
GARTHWILSON wrote:
I find broccoli quite tolerable BTW, but I can't understand why anyone would put coffee in their mouth.

I doubt that I could have survived aboard ship while I was in the Navy without that good old "100 mile" coffee on the mess deck. :lol:

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


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sat Sep 26, 2015 7:20 am 
Online

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
BigDumbDinosaur wrote:
Over in another topic, discussion has ensued concerning a member's "dislike" of the 65C816. To wit:

[ ... ]

However, I'm sure you're right that there are some good things about it that I may not be aware of not having used it much. For one, I believe it's more efficient than the 68000 in terms of clock cycles, though back in the day you couldn't get a 65816 that could be clocked nearly as fast as a 68000. And I suppose that as an experienced 6502 programmer, it may feel somewhat natural to transition to from the 6502.[/color]


I seem to remember that the 65816 could actually be run at 8MHz, but Apple (the only computer manufacturer that used the 65816 at the time, in the IIgs) chose to run it at 2.8MHz to avoid embarrassing the Mac (which had a 68000 at 8MHz).


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sat Sep 26, 2015 1:35 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
rwiker wrote:
I seem to remember that the 65816 could actually be run at 8MHz, but Apple (the only computer manufacturer that used the 65816 at the time, in the IIgs) chose to run it at 2.8MHz to avoid embarrassing the Mac (which had a 68000 at 8MHz).

Your recollection is correct.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sat Sep 26, 2015 1:46 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
My first/second computer had a 6502, and my third computer had a 68000. I didn't learn about the 65c816 until much later. While I have fond memories of programming the 6502, I have no such attachment to the '816. The 68k was nice to work with (even though it was rather slow) and I programmed it mostly in C, something that the '816 wouldn't have been very suited to.

For modern work, where nostalgia isn't the primary objective, I prefer 32 bit ARM microcontrollers.


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sun Sep 27, 2015 4:13 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
Arlet wrote:
...I programmed it mostly in C, something that the '816 wouldn't have been very suited to.

WDC wouldn't agree with you on that. Their C compiler for the '816 produces fairly decent code. It helps that the '816 has stack functions that work well with C.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sun Sep 27, 2015 6:01 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Related topic: "Not much love for the poor 65816?" (three pages at the time of this writing)

_________________
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sun Sep 27, 2015 6:44 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
The fact that there is a compiler doesn't mean that the target is well suited to it. There are also C compilers for the small PICs and for the 8051 family, but these targets aren't really well suited either. The stack functions help a great deal compared to the 6502, but the banked nature make it very hard to produce good code that can access more than 64KB core/data.

The limited registers, basic arithmetic/shift arsenal, lack of multiply (used quite a bit when using arrays of structs), and the lack of 32 bit instructions, make things not necessarily harder for a naive compiler, but does it make it a lot more inefficient, requiring calling subroutines (or use big macros) for many things that the 68k and other same era CPUs can do natively.

Overall, it was a case of "too little, too late". When it came out, it was much nicer than the 6502, but no match for the 68020, the 80386, or the first ARM, that arrived around the same time.


Top
 Profile  
Reply with quote  
 Post subject: Re: The 65C816 is yucky!
PostPosted: Sun Sep 27, 2015 7:11 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Quote:
Overall, it was a case of "too little, too late". When it came out, it was much nicer than the 6502, but no match for the 68020, the 80386, or the first ARM, that arrived around the same time.

They cannot be considered to be in the same league though. The 68020 was at least $500 when it came out, possibly quite a bit more. (The article I found on it said it was $500, and I don't know if it had already come down some by then.)

_________________
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?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 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: