Hugh Aguilar wrote:
What the 65c02 desperately needed was a (zp,x),y addressing-mode --- the 65c816 failed to provide this, so I considered the 65c816 to be no good.
I do seem to have a vague memory of wishing there were something like that once; but since it was a rare and long-ago wish, I wouldn't call it a "desparate" need. Can you give examples of what you would like it for? The '816 took care of some of the needs by offering 16-bit index registers.
Quote:
The 65c816 did provide an (offset,s),y addressing-mode --- that was provided to support the C local-frame --- this isn't very useful in Forth
Agreed. I think I only used it once in my '816 Forth.
Quote:
because, although we may have local variables on the return-stack (this would mean that we can't have >R etc.), most of the work is done on the parameter-stack using the zp,x addressing-mode (and because there is no (zp,x),y addressing mode all pointers have to be moved to a zp-pair which is the bottleneck).
Moving pointers to a ZP pair is something you have to do if you split the stack, which I mentioned earlier as a reason not to do it, as so many stack cells are addresses for things like @ and !.
Quote:
All in all, the 65c816 was a big failure. WDC was trying to support C, which means that they were competing against the MC68000, and so the 65c816 was always considered to be a poor-man's MC68000, which isn't the best way to dominate the market.
My understanding is that the 68000 was much better suited for C but that otherwise it was not a very good performer, even compared to the '816.
Quote:
GARTHWILSON wrote:
Quote:
The 65c02 does need some extensions. There was a version of the 6502 that had instructions for setting individual bits, and that was a pretty good extension.
It sounds like you're referring to the SMB and RMB instructions, and they also go with the BBS and BBR instructions which can examine a bit and branch on the condition you specify, all in one instruction, without affecting A, X, or Y. All the 65c02's being produced today have those. Unfortunately they're only for ZP. They were apparently made for '02-based microcontrollers that had their I/O in ZP, which is not the case with most designs that have the I/O separate from the processor. These instructions are the only ones that are left out of the '816, as it needed the space in the op code table which is full with things that are more valuable.
Another failure of the 65c816! Everybody in the 6502 community considered these to be a great extension --- but they weren't provided in the 65c816 --- wtf???
Everybody?? I never used them, because they were limited to ZP, and I never had my I/O in ZP. Jeff Laughton (forum name Dr Jefyll) has even faster I/O for the 65c02, trapping single-cycle unused op codes, at
http://wilsonminesco.com/6502primer/potpourri.html#Jeff . Rather than use SMB with 5 cycles for example, you can do it
in a single cycle with his techniques, ie five times as fast. The '816 does not offer any single-cycle unused op codes, but the 2-cycle WDM instruction with its one-byte operand leaves more possibilities, which he's developing at the moment. They're not memory-mapped, so the contents of the direct-page and bank registers are irrelevant. It does require external logic, but keep reading:
Quote:
I don't see a problem with these only working in zp. An FPGA processor will have its I/O built-in and can put the I/O ports anywhere in memory --- zp is the best place for the I/O ports because zp addressing is faster than extended addressing
True—although if you're going to use programmable logic, Jeff's improvements become much faster I/O than using I/O ICs in ZP with standard instructions.
Quote:
--- for example, the 6510 used in the Commodore-64 had two I/O ports at the bottom of zp (used in the Commodore-64 for memory-bank switching).
and I just found out the 6502 Atari computers commonly used a banking scheme that allowed access to a megabyte of memory through a 16K window at $4000-7FFF. (I don't know where they put the bank-selection output though.) This came up because of Jonathan Halliday's impressive progress on his preemptive multitasking GUI OS for Atari 6502 computers, shown at
https://www.youtube.com/watch?v=T14dL9M ... e=youtu.be where he runs it at 1.79MHz. (I mention the speed because someone was sure it was on a much faster emulator; but no, he says it's 1.79MHz.) The Wikipedia article on ARM says the 6502 was not fast enough to do a GUI; but Jon is proving them wrong, doing not only a GUI, but preemptive multitasking (although of course if he had to do it with 1600 dots across the monitor, there's be a problem).
Quote:
Multiplication is primarily needed for motion-control --- that can't be done with table look-up.
8-by-8-bit can be looked up directly, because there are 65,536 16-bit answers in the multiplication table. For more than 8 bits, you can still use the table to speed up the process, although it will no longer be single-step.
Quote:
BTW: I'm familiar with the PIC16. That thing was a PITA to program because everything was going through the W register, and it had a funky memory-bank system. The 65c02 was much easier to program, but it didn't run very fast. The PIC24 is easier than both though, as it has 20 16-bit registers and orthogonal addressing-modes --- it is really the best 16-bit processor available.
Yep, the PIC16's processor is a pain in every respect, and I can make a long list. I have used it for every reason
except that decrepit processor Microchip used to brag about. The microcontroller family was inexpensive, came with loads of onboard microprocessor support (power-up timer, brown-out reset, watchdog, etc.), had lots of variations of I/O modules, was programmable on the workbench (
unlike the mask-programmed 65134 and 65265), and were available in any quantity, in stock at many distributors. Those, and not the processor itself, are why I used them. Over the years, I developed a lot of macros that hid a lot of the ugly internal details so I wouldn't curse it so much. Its performance is not particularly good though. For the most part, I found that it took the PIC twice as many instructions, and twice as many clocks, to do a job as the 6502—if the PIC could do it at all; and they both run at 20MHz, so that means the 6502 is generally about twice as fast.
Quote:
Testra built their own processor called the MiniForth which was built on the Lattice isp-1048 PLD. I wrote the assembler/simulator/compiler which I called MFX (MiniForth Cross-compiler). I was told at this time that multiplication was the bottleneck in motion-control.
That sounds very attractive. Were other Forth processors considered before making that decision, like the RTX2000 or SC32?
Quote:
I do think that the 65c02 has a future --- but high-speed motion-control is beyond its ken --- the 65c02 is going to be used for more pedestrian applications, and low-cost will be its primary feature.
I expect do it, but it's not what Bill Mensch is interested in. One of his licensees is running a 65c02 at over 200MHz, and Mesch estimates that in a 20nm geometry, it could hit 10GHz. (They expect 10nm by next year, which would further increase that speed.) Bill Mensch however has rejected making WDC a public corporation, and that has both some pluses and some minuses.
Quote:
GARTHWILSON wrote:
Quote:
It is a mistake to get carried away with nostalgia and limit oneself to the 65c02 of 30 years ago --- it is better to have an upgraded modern processor, which is yet based on the 65c02.
So...you're talking about the ARM. Bill Mensch himself did some consulting to help the ARM designers.
I never heard about this happening.
"Consulting" was probably a poor choice of words. It is my understanding that he did not design any part of the ARM, but they visited him and asked his advice about various things, including after they went back home, and he was happy to help, not viewing their ambitions as any threat to his own. One of the interviews where he mentions this is at
http://ataripodcast.libsyn.com/antic-in ... -6502-chip . He mentions benchmarks at about 23 minutes into it, and ARM at about 39:30-40:10. Sophie Wilson was amazing. Acorn's CEO at the time, Hermann Hauser, recalls that "while IBM spent months simulating their instruction sets on large mainframes, Sophie did it all in her brain." Now
that is a
real engineer!
Quote:
and the name changed to (Advanced RISC Machine)
I think Bill Mensch said in the interview linked above that they quit saying it stood for anything, because it wasn't really a RISC.
Quote:
its primary feature is fast ISRS because it has those shadow-banks of registers
How well does it handle nested ISRs, for when you want to allow the servicing of one interrupt to be interrupted by a higher-priority, quick-to-service interrupt, something as simple as IRQ and NMI? Z80 apparently had a second register set to speed up interrupt response, but this was of no value when you nest interrupts.
Quote:
Anyway, the 65c816 was a big failure. It was used in the Apple-IIgs which was always considered to be a poor-man's Mac and hence didn't last long.
Apple intentionally ran it at only 2.8MHz, well below its potential, to keep it from making the 68000 look bad. Apple killed the IIgs.
Quote:
The only real success of the 65c816 was the Super Nintendo. I remember in the late 1990s that WDC had a bad reputation because they focused entirely on supporting Nintendo which was their cash cow, and they didn't provide much support to their other customers. Their attitude was: "Unless you are buying chips by the truckload then we don't have time to talk to you." Then the Super Nintendo became obsolete, and the 65c816 did too.
WDC now makes most of their money licensing the IP. In the mid- to late-90's, they voluntarily (without my requesting them) sent me a couple of 65802's; so I have to wonder what the whole story is about not having to pay attention to anyone who didn't buy a truckload of them.
In 1993 my assignment was to develop the Cadillac of private-aircraft intercoms. It became totally out of the question to control all the features with discrete logic, so in the early stages of development, I considered several different microcontrollers for the job. Many had severe limitations for our application. One manufacturer actually told us that we basically were too small for them to be interested in our business. We settled on one of the Motorola 68HC11's. Unfortunately the auto industry had the version we needed with EEPROM and lots of EPROM all locked up and on allocation, and not easy to buy. As it ended up, we just went back to a discrete 65c02 computer on its own board. Our cost for parts and labor was approximately what the HC11 was going to cost anyway—it just took a little more room. We sold that for 13 years, and never had any trouble getting parts, in spite of our small volume.
The fact remains that my '816 Forth runs two to three times as fast as my '02 Forth at a given clock speed. I'd say that's not bad at all.