6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 3:45 pm

All times are UTC




Post new topic Reply to topic  [ 149 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  Next
Author Message
 Post subject: Re: game machines
PostPosted: Sun Apr 22, 2018 3:55 am 
Offline

Joined: Fri Jun 03, 2016 3:42 am
Posts: 158
sark02 wrote:
That all said, nobody is going to pay $200 for a new device with a user base of fewer than 5 people.

I think a reasonable game-machine could be built out of the PIC24FJ256DA210.
It is designed to be a business machine with a 640x480 display, but it also has a 480x272 display that seems more appropriate for games --- it doesn't have sprites, but I wasn't enthusiastic about sprites anyway because the games tend to all look alike because they all involve a few objects chasing each other around in flatland (Ms. Pacman and the ghosts, for example) --- a 32 Mhz. PIC24 has enough horsepower to repaint the entire frame-buffer on every heart-beat, and given no rules for how this is done there is plenty of opportunity for creativity in what the game looks like.

The PIC chip provides a lot of features, such as all the video support, ADC for voice synthesis, USB for program development, etc.. It would be pretty much a single-chip board --- build the board for $20 and sell it for $200 --- should have more that 5 customers pretty soon...

If anybody wants to work with me on this, send me a PM.


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Sun Apr 22, 2018 4:07 am 
Offline

Joined: Fri Jun 03, 2016 3:42 am
Posts: 158
DerTrueForce wrote:
Hugh Aguilar wrote:
I'm not opposed to the 65c816 if it could be upgraded with an OSX prebyte like on the M65c02A --- without that, Forth is too bloaty and slow to bother with.

I would dispute this. What you have in mind would call for this code(AIUI):
Code:
OSX
PHA

OSX
PLA

Very easy, I'll give you. two bytes and four cycles(assuming OSX takes two cycles) per 8-bit operation. But the same can be done on existing hardware with:
Code:
INX
STA dataStack, X

LDA dataStack, X
DEX

Which would be three or four bytes and 6 cycles(7 for the push if not in DP) per 8-bit operation, depending on whether you put the data stack in direct page or not. It's bigger, but it is no more contorted than the OSX opcode It's a little slower, but I don't see that being a problem if you run the CPU at a decent frequency. If you can get the thing running at 8 or 10 MHz, you'll hardly notice the difference.

I notice a lot of things! One of the things that I have noticed is that you posted non-working code. The Forth data-stack is 16-bit, not 8-bit, so you need two INX and two DEX.

I also notice that you aren't considering using OSX to allow the (offset,S),Y addressing-mode to be used with X rather than S, which would be useful for cases in which a pointer to a struct is on the data-stack.

DerTrueForce wrote:
Both require that you set aside X for the data stack pointer, so in that sense they are both equally contorted.
Of course, if you absolutely refuse to use any extra bytes than you theoretically could(because that is what I see you doing here), you could always map some dedicated stack hardware into DP, and then you'd be able to push and pull from A without needing to set aside X at all. Then you'd just STA dp for PHA, and LDA dp for PLA.

If I was going to "map some dedicated stack hardware into DP" then I would be making a major modification to the 65c816. If I'm building a new processor, I would use the TOYF that I designed to support Forth.

DerTrueForce wrote:
And to be blunt, I don't see that Forth would bring in many people anyway. It is not well known, and operates in a strange manner, if you're coming from languages such as C, which are far more commonly known. Include it by all means, but don't make it the only option. I'm interested in fiddling around with Forth...

To be blunt, I don't think you have a positive contribution to make to Forth --- you are driven by arrogance and informed by ignorance --- I recommend that you just stick with C; you can continue to toss vague insults at Forth by saying that it "operates in a strange manner," and all of your fellow C programmers will applaud your genius, or at least your loyalty.


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Sun Apr 22, 2018 4:18 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
OK, let's not attack people - it's sufficient to criticise ideas. If you just can't agree with someone, ignore them. A stream of rebuttals and counter-rebuttals is not productive, and degrades the forum for everyone.


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Sun Apr 22, 2018 5:54 am 
Offline

Joined: Fri Jun 03, 2016 3:42 am
Posts: 158
BigDumbDinosaur wrote:
Hugh Aguilar wrote:
Quote:
I'm not opposed to the 65c816 if it could be upgraded with an OSX prebyte like on the M65c02A --- without that, Forth is too bloaty and slow to bother with.

You keep making this assertion, despite no evidence to support it. Can you provide a link to a Forth that is bloaty and slow running on a 65C816? I'm aware of Garth's 65802 Forth, which he has described as running considerably faster than the 6502 equivalent.

I've seen some example code from Garth's 65c816 Forth, and it would likely be an order of magnitude slower than C code --- that is too slow to bother with --- he is using ITC (indirect-threaded-code) that has the advantage of being very compact (in the 1970s when Charles Moore invented ITC, a micro-controller might have only a 2KB EPROM), but it is not appropriate for the 65c816 that likely has 64KB of code memory and 64KB or more of RAM. STC is a lot more efficient, especially with peephole-optimization, but the 65c816 needs better support for using the X register as a data-stack pointer.

Speed is not necessarily required for micro-controller applications, so Garth's ITC Forth could still be useful. By many accounts, the most important feature of Forth is interactive development. You can execute code from the command-line and get immediate response. You can write short test functions on the command-line and execute them immediately. This is very useful! In most cases, a board doesn't do what the electrical engineer says that it does. This is because the hardware design is bad, the electrical technician built a bad board, or because of environmental issues such as EM pollution. From the command-line, it is possible to test the board and find out what it does. This is done before the program is written. Also, I have seen many cases in which the electrical technician has a test suite of Forth functions that he or she uses to test the boards after building them --- he or she is not actually a Forth programmer, but just knows enough about Forth to use the test functions on the command-line (there are actually more women than men doing this, probably because they have a lighter touch on the soldering iron than your typical ham-handed man).

Anyway, it is a straw-man argument to say that a 65c816 Forth is faster than a 65c02 Forth, because I never said otherwise. Obviously, if you have 16-bit registers then that is going to be faster than 8-bit registers.

My point is that the 65c816 is not fast enough. It is a bad design. William Mensch was opposed to using prebytes, such as are used on the MC6809, but the result was that his ISA is too redundant and has too many missing features.
If you have an OSX prebyte to switch S and X in the next instruction, then you can get rid of the offset,S addressing-mode because it is redundant to the offset,X addressing-mode. You can also get rid of the (offset,S),Y addressing-mode and replace it with a (offset,X),Y addressing-mode that could be used for S instead of X with an OSX prebyte (this would not only support Forth, but would support arrays of pointers to structs in zero-page).
Also, if you have an OAY prebyte to switch A and Y in the next instruction, then all of the instructions (ADC, EOR, etc.) that use A and a memory value can use Y and a memory value also.
If he didn't have so much redundancy in the ISA, he would have had more room in the 256-opcode space to add more instructions. For example, he could have added a Y addressing-mode so the instructions that use A and a memory value could use A and Y instead. This would be a kind of inherent addressing-mode as there would be no operand, and it would be quite fast --- normally the result would end up in A, but given the OAY prebyte the result could end up in Y.

I liked the 65c02. I wrote a Forth cross-compiler that ran under MS-DOS UR/Forth and generated code for the Apple-IIc (I actually had a Laser-128). This was compatible with ISYS Forth that ran on the Apple-IIc. This generated faster code than any C or Pascal compiler of the day --- I doubt that it would generate faster code than Walter Bank's 65c02 C compiler --- but for its time period, it was quite efficient.
I used my cross-compiler to write a program to do symbolic math. My program could do derivatives of equations and then simplify the results. My program could also plot functions on the graphics screen and display equations using math symbols and Greek letters. My goal was to do integrals, but I found that to be beyond the capabilities of the 65c02 --- I had really pushed the capabilities of the 65c02 quite a lot already.
The 6502 does have some bad features (for example, INC and DEC should set the CF the same as ADC or SBC do). For the most part though, the 6502 was a good design --- the (zp),Y addressing-mode was pretty awesome.

Nowadays I think the 65c02 is obsolete. The 65c02 is designed for big programs (such as my symbolic-math program). It has the (zp),Y addressing-mode that provides good access to big data-structures. Nobody wants to use an 8-bit processor for big programs now though. People use 16-bit or 32-bit processors for big programs now.

In its day, the 6502 was better than the Z80 for big programs because (zp),Y provided better access to data-structures. The 6502 was better than the Z80 for small micro-controller programs too, because the 6502 had less interrupt-latency due to having only a few 8-bit registers to save/restore.
Both the 6502 and the Z80 were obsoleted by the MC6809 though, and the MC6809 was obsoleted by the MC68000-family, and the MC68000-family was obsoleted by the ARM --- the ARM Cortex dominates now, and will likely to continue doing so all the way through the 21st century (it is more than powerful enough for any micro-controller application) --- nobody is going to be interested in an 8-bit game-machine now.

People still use 8-bit processors for small micro-controller programs. The 8051-family has been popular for three decades, and continues to be popular. The STM8 is gaining some steam. I designed my 65ISR for small micro-controller programs. It should be significantly easier to program than the 8051-family, that lacks an indexed addressing-mode. It should be more efficient than the STM8 because the STM8 gets bogged down in entrance and exit code for ISRs --- the 65ISR (as the name indicates) is intended to have very little interrupt latency (it has less than the 65c02, and low interrupt-latency was always the hallmark of the 65c02).

BigDumbDinosaur wrote:
As a well-written Forth kernel tends to be quite efficient (efficiency being one of the hallmarks of Forth), I'd expect that a kernel optimized for the 65C816 running in native mode would see a substantial performance gain.

It is obvious that William Mensch wanted to support C programming, so he added the offset,S and (offset,S),Y addressing-modes, but he was failing to support Forth.

If he doesn't want to support Forth, then I don't want to support his 65c816.

The 65c816 ISA was designed to support C, so supporting Forth is going to require contorted programming. I would do that if I was getting paid --- I'll do most anything for money, so long as it is not immoral or illegal, and I'm totally okay with implementing bad ideas --- do you want to hire me to write a Forth for the 65c816?
You've already said on this forum that you will never be convinced that Forth has any value, so I'm expecting that you are not going to hire me --- you don't actually believe what you said: "a well-written Forth kernel tends to be quite efficient (efficiency being one of the hallmarks of Forth)"


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Sun Apr 22, 2018 6:53 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Hugh Aguilar wrote:
I've seen some example code from Garth's 65c816 Forth, and it would likely be an order of magnitude slower than C code --- that is too slow to bother with --- he is using ITC (indirect-threaded-code) that has the advantage of [...]

If you like, you could take my definitions there and adapt most of them to STC Forth with no changes.

I did this digital-storage oscilloscope application on my '02 ITC Forth running at 5MHz, taking sets of four analog samples a thousand times per second, to figure out a problem with a switching power supply under a fast-changing load, in high-level Forth, with no assembly language in the ap.  The samples were then played back on a dual-trace analog oscilloscope for viewing:
Attachment:
SMPStestScope.jpg
SMPStestScope.jpg [ 63.69 KiB | Viewed 348 times ]

I'm not too concerned about trying to get Forth's speed to match that of assembly though, because it is super easy to mix assembly into the Forth when necessary.  That might not be so easy on more-complex processors, but it is on the 65's.  As they say, you can get 95% of assembly's performance with only 5% of the code in assembly, provided it's the right 5% (or change the numbers to 90% and 10% if you like—you get the point).  I could have made it sample much, much faster if I wrote a simple sample-taking ISR in assembly language and integrated it with the Forth.  It would integrate seamlessly, and the majority of the code would still be in Forth.  I suspect many people are thinking the assembler is run separately from the Forth compilation, and then the two have to be merged and reconciled somehow.  Not so.  It's all the same environment.

Quote:
that is too slow to bother with --- he is using ITC (indirect-threaded-code)

On the 6502, NEXT takes about half the processor's time.  On the '816, it's somewhat less.  STC eliminates NEXT but adds a lot of 12-cycle JSR/RTS pairs in its place, so the speed advantage is not as great as one might expect.  (Note that ITC Forth has almost zero occurrences of JSR/RTS.)  STC can straightline some of the small stuff like DROP; but the 816's ability to handle 16 bits at once means a lot more of the words can be primitives (ie, defined in assembly language), resulting in getting the job done without running NEXT nearly so many times.  nest and unnest also get run fewer times to get the job done.  Further, having so many primitives means you can eliminate certain redundant work, further improving efficiency.  For example, when a word is re-written as a primitive, DUPing a cell may be unnecessary, because the following part can just use it without destroying it if it's still needed later in the same primitive.  ROTates and other stack-gymnastics words can also be eliminated, because the primitive can use the data in place instead of needing them moved to the top of the stack first.  Temporary data can be put in N rather that on the stack, so the indexing is eliminated, along with more DUPs, DROPs, etc..  Things like this narrow the performance difference between ITC and STC.

Quote:
Both the 6502 and the Z80 were obsoleted by the MC6809 though,

The 6809 had a very nice instruction set.  Note however that it hardly (if at all) outperformed the '02 at a given clock speed, and then the '02 achieved much higher clock speeds.

I'm always in favor of giving the user a choice of development languages, whether it's a game machine or any other kind of computer.  I would like the choices to be good representations of those languages though.  There have been a lot of BASICs and Forths and Cs that did not do the name of BASIC or Forth or C any favors.  It's most helpful for the user, I believe, to experience what a good representation of the language can do.  Even assembly language can be raised to a much higher level than most assembly-language enthusiasts realize, with, in most cases, no penalty in performance or code size.

_________________
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: game machines
PostPosted: Sun Apr 22, 2018 7:20 am 
Offline

Joined: Tue Nov 10, 2015 5:46 am
Posts: 230
Location: Kent, UK
Hugh Aguilar wrote:
Nowadays I think the 65c02 is obsolete.
While that may be mostly true (one man's obsolete is another man's perfect fit), you are on a 6502 forum, so it would be nice to get just a little love for it.

Quote:
In its day, the 6502 was better than the Z80 for...
Imma stop you right there.

Quote:
Both the 6502 and the Z80 were obsoleted by the MC6809 though, and the MC6809 was obsoleted by the MC68000-family, and the MC68000-family was obsoleted by the ARM
In general computing the 68000 was obsoleted by the x86. In embedded systems it was obsoleted by the PowerPC (the 68360 and CPU32 cores lived a long life... with CPU32 cores still available from NXP). After doing modestly in the 90s as a rival to Atari STs, Amigas and early IBM PC clones, Acorn's Archimedes line (for which the Acorn RISC Machine - the ARM - was developed) quietly died... pretty much taking the company with it. As I recall it was actually Apple, with their Newton handheld that directed them towards selling the ARM, with its excellent power profile, into embedded systems. Now ARM is everywhere, as you say, but they still haven't made inroads into servers and desktops - though they keep trying (e.g. with ARMv8 cores). ARM cores are pretty expensive to license, and now I wonder if RISC V (the new kid of the block, and a response to high licensing fees) is going to eventually take them down. ARM is so entrenched, I suspect that will take decades, though (just like the CPU32 cores are still available and, no doubt, in use by those same "perfect fit" people).

Quote:
do you want to hire me to write a Forth for the 65c816?
The question wasn't to me, but FYI if I wanted a Forth on any system, I'd want to hire a language expert.

If you look at the list of top programming languages (https://www.tiobe.com/tiobe-index/ being one such example) you'll see (unordered) C, C++, C#, Java, Javascript, Python, VisualBASIC, Go, Perl, etc. These are the relevant languages of modern times. Forth has some niche use-cases, but it's uncommon, and I think it's a stretch to ask for people to adopt your pet language.

If you proceed with your PIC idea then the best of luck to you. It does look like a capable little chip.


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Sun Apr 22, 2018 9:45 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Bit of a digression here, but this thread seems to be digression city...

Quote:
Acorn's Archimedes line (for which the Acorn RISC Machine - the ARM - was developed) quietly died... pretty much taking the company with it. As I recall it was actually Apple, with their Newton handheld that directed them towards selling the ARM, with its excellent power profile, into embedded systems...


I think there might be two, or even three, halves to that story. AIUI, ARM was spun out from Acorn at the time of the Newton, because Apple wanted their CPU supplier not to be a direct competitor in the computer market. But then Steve Furber tells the story that Robin Saxby was anxious to find a way out from under its owners - it couldn't grow a commodity business and become self-sufficient with Apple and Acorn demanding all their technical attention. And that's where the licensing model came in, giving the cashflow to become more effectively independent (the power to say no).

The third half of the story is that Apple was able to keep itself afloat when in deep trouble by selling a massive tranche of ARM shares, even at a loss, to generate cash. Maybe in 1998. So Apple helped ARM get started, and some years later got a life-saver from that:

Quote:
"...they were in real trouble, real financial trouble, and in fact they were about to go bust,” said Hauser. “The reason they didn’t go bust was because they sold their ARM stake that they had originally purchased for $1.5 billion for $800 million.”

That’s a staggering $700 million loss, but if not for selling ARM, Hauser says, Apple might not even be here today..."

- from Cult of Mac although Hauser is quoted as saying Sculley did this, whereas here we read that it was Jobs.


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Sun Apr 22, 2018 5:24 pm 
Offline

Joined: Tue Nov 10, 2015 5:46 am
Posts: 230
Location: Kent, UK
BigEd wrote:
I think there might be two, or even three, halves to that story.
Thanks for those details and for the links. I hadn't heard any of that before! Fascinating.


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Mon Apr 23, 2018 12:13 am 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 679
Hugh Aguilar wrote:
it doesn't have sprites, but I wasn't enthusiastic about sprites anyway because the games tend to all look alike because they all involve a few objects chasing each other around in flatland (Ms. Pacman and the ghosts, for example)


You keep saying this, but it's simply not true. Most arcade machines up to the 3d era were sprite based, and pulled off ridiculously varied and high quality graphics. The SNES and NeoGeo games didn't look all alike (except when the genre called for it). Only the earliest of games just used singular sprites for little rectangles running around the screen.

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Mon Apr 23, 2018 1:57 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
Hugh Aguilar wrote:
I've seen some example code from Garth's 65c816 Forth, and it would likely be an order of magnitude slower than C code --- that is too slow to bother with...

That is a subjective opinion that (to me) has no basis in fact. Whose yardstick (or meter stick) was used to determine that Garth's 65C802 code would likely be an order of magnitude slower than C code?

Quote:
Anyway, it is a straw-man argument to say that a 65c816 Forth is faster than a 65c02 Forth, because I never said otherwise. Obviously, if you have 16-bit registers then that is going to be faster than 8-bit registers.

No straw man argument was made in that regard. I was speculating. As I am not a Forth user, I can only speculate on relative performance. It is you who is expressing opinions about the slowness of Forth running on an '816.

Quote:
My point is that the 65c816 is not fast enough.

The 65C816 is "not fast enough" for what? It was certainly "fast enough" for the Apple ][gs, in which had it been clocked as fast as the production 65C816 of the time could go, would have made the MacIntosh not look so good.

Quote:
It is a bad design.

In what respect and compared to what?

Quote:
William Mensch was opposed to using prebytes, such as are used on the MC6809, but the result was that his ISA is too redundant and has too many missing features.

How do you know what Bill Mensch was opposed to? The 65C816 design evolved as it did due to Apple's requirements that it be able to execute 65C02 code without alteration. This was in addition to the native mode features that were designed in to support what Apple wanted to accomplish with the ][gs. Had Mensch elected to use prefix bytes, as you advocate, the backward compatibility demanded by Apple would not been possible. Looking back at it, Mensch's design cleverly maintained the clarity and efficiency of the 65C02 ISA, all the while offering 16 bit performance, broader stack management and greater memory addressing range.

Quote:
Nowadays I think the 65c02 is obsolete.

Noted. :D

Quote:
Both the 6502 and the Z80 were obsoleted by the MC6809 though...

Yet the 65C02 continues on in the present day in huge volumes. That doesn't sound "obsolete" to me.

Quote:
It is obvious that William Mensch wanted to support C programming, so he added the offset,S and (offset,S),Y addressing-modes, but he was failing to support Forth.

Actually, it is neither obvious or true. The 65xx architecture predates K&R C by several years and at the time Bill Mensch commenced with the 65C816 design (c. 1982), C was not all that well known outside the UNIX world. While it is likely Bill Mensch knew about C, there would not have been any logical reason to try to change the 65xx ISA to support that specific language, especially considering there was no official language standard at the time (nor would there be until 1989).

Quote:
If he doesn't want to support Forth, then I don't want to support his 65c816.

Bill Mensch is a designer of general purpose microprocessors, not a software engineer. By definition, a general purpose microprocessor is not tied to a language or operating environment. Support for any language is the job of compiler and interpreter designers, not hardware engineers.

Quote:
The 65c816 ISA was designed to support C...

Repeating that won't make it true.

Quote:
...do you want to hire me to write a Forth for the 65c816?

No, thanks.

Quote:
You've already said on this forum that you will never be convinced that Forth has any value, so I'm expecting that you are not going to hire me --- you don't actually believe what you said: "a well-written Forth kernel tends to be quite efficient (efficiency being one of the hallmarks of Forth)"

I don't recall ever saying Forth has no value. It has no value to me in my professional and hobby computing activities, but patently has value to others.

As for my comment about a Forth kernel's efficiency, yes I do believe what I wrote—I otherwise would not have written it. Properly written Forth kernels tend to be economical with machine resources, which is what defines efficiency at the hardware level. In that regard, Forth is no different than any other operating environment, even one as primitive as a machine language monitor.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Mon Apr 23, 2018 2:07 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
BigEd wrote:
Bit of a digression here...The third half of the story is that Apple was able to keep itself afloat when in deep trouble by selling a massive tranche of ARM shares, even at a loss, to generate cash.

Yes, I now vaguely recall that from long ago. There was a write-up on it in the Wall Street Journal, along with some alarmist speculation that Apple was about to close up shop. It was from the time when PC technology was rapidly catching up with the Motorola 68K machines and the future of the 68K in desktop computing was starting to look bleak. That had to be scary to Apple, given the huge investment they had in the Mac.

Interestingly, it was also around that time that the proprietary minicomputer market was starting to crumble from the onslaught of RISC machines, as well as the realization that the 80386/80486 could efficiently run a genuine UNIX kernel in protected mode. Most of those soon-to-be-obsolete minicomputers were powered by the 68K.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Mon Apr 23, 2018 3:44 am 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 679
Hugh, i think still think you need to lay out some more design goals for this project. Most of what you respond is negative about other ideas, but we're left scratching our heads as to what direction you're actually striving for. As a game machine, what sort of sample game idea, given some sort of sample hardware & software architecture it could take advantage of, would exemplify your ideal?

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Mon Apr 23, 2018 4:32 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
In some ways I'm inclined to agree with Hugh. Certainly Michael's M65c02A sets a very high standard for Forth performance, and it'll trounce an '816 running Garth's Forth.

Hugh Aguilar wrote:
[Garth] is using ITC (indirect-threaded-code) that has the advantage of being very compact
Yes, compact. Which goes hand in hand with being slow. And, as noted, 2KB EPROM's are a thing of the past. Can we agree it's alright to look at slightly bulkier alternatives?

You mentioned Forth using STC (subroutine threaded code), which indeed is quite a lot faster than ITC. I don't understand your comment about the '816 needing better support for X as a data-stack pointer (for the most part I find it adequate). Be that as it may, there's at least one other fast alternative -- namely, Forth that uses DTC (direct-threaded-code).

I guess I'm saying we need more points of comparison than just sluggish ITC vs M65c02A, which are at opposite extremes, performance-wise.

-- Jeff

ETA: when I say "at opposite extremes," I mean within the context of various Forths -- all of which tend to be remarkably performant, even the comparatively slow ones. Garth's ITC application illustrates this.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Tue Apr 24, 2018 12:45 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Mon Apr 23, 2018 4:54 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
BigDumbDinosaur wrote:
Quote:
It is obvious that William Mensch wanted to support C programming, so he added the offset,S and (offset,S),Y addressing-modes, but he was failing to support Forth.

Actually, it is neither obvious or true. The 65xx architecture predates K&R C by several years and at the time Bill Mensch commenced with the 65C816 design (c. 1982), C was not all that well known outside the UNIX world. While it is likely Bill Mensch knew about C, there would not have been any logical reason to try to change the 65xx ISA to support that specific language, especially considering there was no official language standard at the time (nor would there be until 1989).

If the 65816 was responding to desires by Apple, then C support certainly wasn't a criteria, notably since Apple was heavily invested in Pascal back then. Pascal was manifest as both native Pascal compilers (used by the Lisa, Macintosh, and IIGS), as well as the UCSD Pascal Runtime running on the Apple ][ series. The '816 would have been a pretty good target for the P-Machine.

Now, stack addressability is a pretty common technique in most scoped high level languages. Pascal was notable for its multiple, nested scopes (something C does not have).

The 6502 was a pretty good Forth processor, not sure why the '816 would have been crippled by running Forth. All of the languages would have had to fight the 16b/24b addressing nature of the machine. 8086 faced the same problem, but the 8086 relied on a 16bit segment register vs '816 8 bit bank register. But I don't know how much that would have really mattered in practice.

The Z80 has several prefix bytes. Similarly, there are several articles about how you can do the things that the prefix byte instructions do -- without using the prefix byte instructions to save time and cycles. Not sure how much of a fan base prefix bytes really have in the Z80 community.

Finally, contrasting something like the M65c02A, something made with 40 years hindsight and modern tools for simulation compared to the '816 which had work started probably about 5 years after the 6502, is a bit unfair. I don't know much about the M65c02A, but what kind of transistor budget would it require in contrast to the '816, which along with 6502 interoperability no doubt loomed over many design decisions.


Top
 Profile  
Reply with quote  
 Post subject: Re: game machines
PostPosted: Mon Apr 23, 2018 7:47 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Something that really helps in discussions such as these, I think, to avoid them becoming heated and becoming an expanding tree of point-by-point rebuttals, is to phrase controversial opinions as opinions. No-one minds anyone finding some particular piece of hardware or software not to be elegant, or useful, or ideal, but you'll often find someone with the opposite view. Saying that something is so, as if it were a truth universally acknowledged, just brings argument. In my opinion.

The other thing that's worth being careful about is throwing in every observation that comes to you: if you raise five points in a post, you might get five responses, and if those are not on-topic, you've got a sprawling thread on your hands. It's very cheap and easy to start a new topic, and if when doing that you find your nugget of wisdom doesn't quite hold up as a new thread, well, you know what to do.

Having said that... about the 65816. Two observations, if I may: it was made with very limited resources, and it was to be backward compatible. In that situation, if the thing ever comes to market, I think you'll find it won't contain every feature which might have been useful.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 149 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  Next

All times are UTC


Who is online

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