65C816 - Why?
65C816 - Why?
I have been thinking about some new projects and have a few ideas in mind for the 6502. However, I've been thinking about the 65C816. As something to do it has a bit of merit, but for the life of me, beyond having the experience of creating it I can't think of a compelling reason to do so.
Sure, I could re-write a few assembly language routines to take advantage of the 16 bit extensions, but for the most part I can see no real way to take advantage of the extra oomph the chip offers. Other than apple GS/OS has there ever been an operating system built for the 65C816? Even still, id I wanted to run that it might be better just to buy a used Apple IIGS. How about language interpreters or code libraries?
It seems to make little sense to me to build such a machine only to have to run like it was a 6502. It would be a bit like owning a Porsche GT3 to deliver pizza in suburbia.
Sure, I could re-write a few assembly language routines to take advantage of the 16 bit extensions, but for the most part I can see no real way to take advantage of the extra oomph the chip offers. Other than apple GS/OS has there ever been an operating system built for the 65C816? Even still, id I wanted to run that it might be better just to buy a used Apple IIGS. How about language interpreters or code libraries?
It seems to make little sense to me to build such a machine only to have to run like it was a 6502. It would be a bit like owning a Porsche GT3 to deliver pizza in suburbia.
Bill
Re: 65C816 - Why?
Perhaps see also this previous discussion:
Re: 65C816 - Why?
You may want to keep an eye on this new (probably commercial) project - nothing to 65c816 @ 14Mhz with video, sound and storage (and a nice box) in under 6 months:
https://www.c256foenix.com/
It's looking very promising and from what I've read on their forums, software is progressing.
I started my own 65c02 SBC recently (after having made several some 30 years ago), but have changed track with the aim to make a 65c816 system. I have a very good idea of the operating system and languages I want to run on it though - hopefully I can write more on it in the new year.
So - with that in-mind, I'd suggest that if you want a 6502 SBC sort of thing, then do it, but with just a couple of design changes that can be implemented with jumpers, you can have a 64K 65c816 system which might give you a bootstrap into the '816 world...
-Gordon
https://www.c256foenix.com/
It's looking very promising and from what I've read on their forums, software is progressing.
I started my own 65c02 SBC recently (after having made several some 30 years ago), but have changed track with the aim to make a 65c816 system. I have a very good idea of the operating system and languages I want to run on it though - hopefully I can write more on it in the new year.
So - with that in-mind, I'd suggest that if you want a 6502 SBC sort of thing, then do it, but with just a couple of design changes that can be implemented with jumpers, you can have a 64K 65c816 system which might give you a bootstrap into the '816 world...
-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 65C816 - Why?
BillO wrote:
I have been thinking about some new projects and have a few ideas in mind for the 6502. However, I've been thinking about the 65C816. As something to do it has a bit of merit, but for the life of me, beyond having the experience of creating it I can't think of a compelling reason to do so...It seems to make little sense to me to build such a machine only to have to run like it was a 6502. It would be a bit like owning a Porsche GT3 to deliver pizza in suburbia.
That said, I think part of what makes a hobby a hobby is going beyond the status quo and coming up with something the other guys haven't done. Perhaps a careful study of the '816 hardware may lead you to identifying a desire you didn't know was there. Also, the '816 offers a plethora of software features that, once understood, can have a surprisingly strong effect on how you write your programs. Once you go 16 bit you start wondering how it was you managed with only eight bit arithmetic, an eight bit stack pointer, etc. Even if you don't build your gadget with extended RAM, you can quickly find a lot about the '816 that makes it appealing.
I encourage you to consider the 65C816, if for no other reason than that of it being available.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: 65C816 - Why?
The 65816 is an enormously frustrating chip. Parts of it I've fallen in love with, like the stack stuff, and it's really, really hard to go back to 8-bit after using a 16 bit processor. Others I absolutely hate -- the decision to have a mode switch and use the same opcodes for 8 and 16 bit was, ahem, debatable and the new mnemonics are bad enough I ended up creating my own. It's a real missed opportunity, and I wish somebody could convince WDC to go back and do a clean 16 bit version of the 65816. There are basically no other 16 bit processors out there in this package, AFAIK. In few years, it will either be the 65c02 or directly up to a RISC-V variant.
Still, as BDD said, the 65816 great as a hobby project.
For software, the practical barriers are that there is no easy to use emulator like the py65 for the 6502 you can just sit down and play around with; the same goes for assemblers. I ended up writing my own of both, which was a great experience in itself, but they're not really "easy to use" by anybody's definition (one is in Forth). I have back burner projects for both a new emulator (in Go this time, to force me to learn golang) and an assembler (in Python, to learn how to write real lexers, parsers etc). In that respect, the 65816 is fantastic because it has all kinds of weird edge cases -- the Forth emulator finally helped me understand how to use DEFER, for instance.
For hardware, the chip needs more complicated memory signals, but I think the main barrier is that there isn't a simple bare minimum reference design out there like Garth's for the 6502. If we had something like that, it would be a lot easier to say to yourself, dude, I can totally do this, and then things would positively feed into themselves, even after you found out you were actually in over your head. By then, as a lot of us know, it's already too late.
Another way of dealing with the 65816 I have thought about would be to create a bytecode interpreter for it, that is, put a thin software layer over it to make it more accessible. That would make it a better target for high-level languages. PLASMA went this way with the 65c02, but it is a bytecode stack machine, and I think a bytecode register machine would be the better, because faster choice: Those great stack instructions of the 65816 would let you access virtual registers with very little trouble. It's on my list, but then again, my list is very, very long by now ...
Anyway, I haven't regretted any of my time with the 65816. Go for it.
Still, as BDD said, the 65816 great as a hobby project.
For software, the practical barriers are that there is no easy to use emulator like the py65 for the 6502 you can just sit down and play around with; the same goes for assemblers. I ended up writing my own of both, which was a great experience in itself, but they're not really "easy to use" by anybody's definition (one is in Forth). I have back burner projects for both a new emulator (in Go this time, to force me to learn golang) and an assembler (in Python, to learn how to write real lexers, parsers etc). In that respect, the 65816 is fantastic because it has all kinds of weird edge cases -- the Forth emulator finally helped me understand how to use DEFER, for instance.
For hardware, the chip needs more complicated memory signals, but I think the main barrier is that there isn't a simple bare minimum reference design out there like Garth's for the 6502. If we had something like that, it would be a lot easier to say to yourself, dude, I can totally do this, and then things would positively feed into themselves, even after you found out you were actually in over your head. By then, as a lot of us know, it's already too late.
Another way of dealing with the 65816 I have thought about would be to create a bytecode interpreter for it, that is, put a thin software layer over it to make it more accessible. That would make it a better target for high-level languages. PLASMA went this way with the 65c02, but it is a bytecode stack machine, and I think a bytecode register machine would be the better, because faster choice: Those great stack instructions of the 65816 would let you access virtual registers with very little trouble. It's on my list, but then again, my list is very, very long by now ...
Anyway, I haven't regretted any of my time with the 65816. Go for it.
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 65C816 - Why?
scotws wrote:
For hardware, the chip needs more complicated memory signals, but I think the main barrier is that there isn't a simple bare minimum reference design out there like Garth's for the 6502.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: 65C816 - Why?
scotws wrote:
For hardware, the chip needs more complicated memory signals, but I think the main barrier is that there isn't a simple bare minimum reference design out there like Garth's for the 6502.
It has all of the peripherals, and it's all discrete logic.
The data sheet describes a small circuit for decoding the 24 bit address bus on, like, page 46. That same circuit is used on the board.
The only thing I can't see is anything done with VDA and VPA, and I know BDD has run in to some instances of that.
So I don't know what that means. The board ties them together with an NAND gate, and labels that SYNCB, but it doesn't seem to do anything with the signal. It doesn't even expose it on the expansion connector.
I think this is necessary for some peripherals that might do unpredictable things with the address bus goes wacky?
Anyway, lots to cherry pick from the WDC board me thinks.
But what the chip doesn't have is a wide array of other implementations. Experimenters and their boards. "3 chip" solutions, etc.
It's "too big" for a simple 8 bit micro, but "too small" for other things. The hobbyist "unfriendly" packaging options don't help.
And, of course, the lack of software. 6502 is popular for it's simplicity, ubiquity, and availability. Z80 is popular because you can get CP/M running on it. Folks are perfectly happy with a Z80 and a dumb terminal. But 6502 seems to require sprites and color and all the rest.
That c256foenix thing is starkly missing any system specs outside of the 14Mhz '816 and a memory map.
Re: 65C816 - Why?
I have not considered using the 65C816 for anything, but if I did, I would probably want something like the barebones schematics on Garth's page with at least one more chip for the third address byte. I don't think any would-be beginner would have the confidence or know-how to go through the schematics for BDD's or WDC's board and figure out what to keep and what to get rid of without breaking basic functionality.
BillO, what things are you using the 6502 for to begin with? Maybe that would suggest where you might need a 65C816. I have nothing against Porches. Maybe it's delivering pizza you should rethink
BillO, what things are you using the 6502 for to begin with? Maybe that would suggest where you might need a 65C816. I have nothing against Porches. Maybe it's delivering pizza you should rethink
Re: 65C816 - Why?
Regarding operating systems, for Atari fans, there is this: http://drac030.krap.pl/en-specyfikacja.php
Myself, I was/am an Apple II clone owner/user (Laser 128EX) who "upgraded" to a 65c802 shortly after and was disappointed at the lack of native software for it. I eventually found something I could hack (HyperC)
that would at least take advantage of most of its native capabilities like 16 bit registers, 16 bit stack and native mode vectors and most of the native addressing modes in a 64k address space.
Downside for me was that the clone's rom is written in 65c02 emulation mode of course so intput/output always had to be executed in emulation mode which required for me saving native stack/restoring emulation mode stack and 16 bit registers before and after switching. A full native mode rom could make a big difference in performance. I estimated a 20% increase in performance in native mode with emulation mode switching for I/O. The editor I was using had smoother faster scrolling with the native interpreter as opposed to the emulation mode interpreter that I hacked.
Although I haven't yet tried it PLASMA has a native interpreter for 65802/816.
65c802s are rare these days. There are alternatives. See a2heaven.com's 65c02->65816 module.
Cheers,
Andy
Myself, I was/am an Apple II clone owner/user (Laser 128EX) who "upgraded" to a 65c802 shortly after and was disappointed at the lack of native software for it. I eventually found something I could hack (HyperC)
that would at least take advantage of most of its native capabilities like 16 bit registers, 16 bit stack and native mode vectors and most of the native addressing modes in a 64k address space.
Downside for me was that the clone's rom is written in 65c02 emulation mode of course so intput/output always had to be executed in emulation mode which required for me saving native stack/restoring emulation mode stack and 16 bit registers before and after switching. A full native mode rom could make a big difference in performance. I estimated a 20% increase in performance in native mode with emulation mode switching for I/O. The editor I was using had smoother faster scrolling with the native interpreter as opposed to the emulation mode interpreter that I hacked.
Although I haven't yet tried it PLASMA has a native interpreter for 65802/816.
65c802s are rare these days. There are alternatives. See a2heaven.com's 65c02->65816 module.
Cheers,
Andy
Re: 65C816 - Why?
whartung wrote:
scotws wrote:
The only thing I can't see is anything done with VDA and VPA, and I know BDD has run in to some instances of that.
I think this is necessary for some peripherals that might do unpredictable things with the address bus goes wacky?
I think this is necessary for some peripherals that might do unpredictable things with the address bus goes wacky?
So this whole refrain of needing to decode valid accesses is a red herring. It's an interesting war story, but nothing more.
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Re: 65C816 - Why?
handyandy wrote:
65c802s are rare these days.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
Re: 65C816 - Why?
Here is something that I think would be fun on a 65816: Scheme or Lisp. If i understand the internal structure, you need two pointers and a bunch of type bits in each cell -- not something you want to do on a 6502. With 16 bit, you could probably get away with it. Think of all the stuff you would have to figure out, GC, interpreter, compiler ... basically, the whole Structure and Interpretation of Computer Programs. That's pretty much enough stuff to last a lifetime.
Re: 65C816 - Why?
I like it!
Re: 65C816 - Why?
Lots of interesting ideas. Thanks for those - fodder for future day dreams.
For the two designs I've just completed (I still have to share them...) one is a workbench computer for experiments and development. The other is mostly for embedded applications (a la Arduino) , but experimentation and development are not a reach for it. Future builds might have different goals.
Even rarer since I bought up most of the stock
Do you have any left that one might purchase???? 
Druzyek wrote:
BillO, what things are you using the 6502 for to begin with? Maybe that would suggest where you might need a 65C816. I have nothing against Porches. Maybe it's delivering pizza you should rethink 
BitWise wrote:
handyandy wrote:
65c802s are rare these days.
Bill
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Re: 65C816 - Why?
BillO wrote:
BitWise wrote:
handyandy wrote:
65c802s are rare these days.
http://www.greenlightelectronics.com/el ... art-search
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs