> Lars Brinkhoff wrote:
> >Mark Wills wrote:
> >> Also, the 6502, whilst a very simple device and quite fast, has a
> >> crap instruction set and no registers.
> >
> >I haven't done any serious 6502 programming, so I wouldn't know.
> >Certainly, handling anything beyond 8 bits is going to be awkward, since
> >it's very insistent on being an 8-bitter.
> >
> >But at least the instruction set *encoding* is quite regular and
> >pleasant. I wrote my own Forth assembler for it, and it turned out to
> >be very simple.
That has to be considered at least moderately serious programming.
> Indeed.
> There are misconceptions about the 6502.
> 6502 is the purest 8-bits processor yet very powerful. The
> implementation of FYSFORTH on the Apple II made it in an actually
> usable piece of equipment in the Fysisch Laboratorium of the Utrecht
> University.
> For the chip real estate it occupies it is one of the best.
>
> If you know the chip you realize that it has 128 16 bit registers
Potentially 128 index register substitutes, which, because you don't have to load them into X (displacing whatever was in X) to use them as index registers, really are that useful.
As compared to the 6800 which also has potentially 128 index register substitutes in page zero, but requires precisely displacing whatever is in X to use them as such.
As accumulators or targets of 16 bit math, the zero page on the 6502 had pretty much the same set of disadvantages as the zero page on the 6800.
> on the zero page. If you don't appreciate that, you're in good company,
> Andrew Tannenbaum didn't realize that fact and dismissed the 6502
> as a potential target for a c-compiler.
Index registers are pretty important for high-level languages, which is why the 6502 was an early target for pascal virtual machines.
But similar, but slightly slower VMs could have been built for the 6800.
C and VMs seem to be anathema, but there really isn't any reason the VM has to have in inner interpreter. Really, even on a large register CPU, the C run time essentially defines a VM that is imposed on the CPU and its register set.
It's a very flexible VM, but it is still a VM. That's perhaps the biggest reason that it's hard to get a classic Forth to co-exist with a C run-time. You have to understand both VMs and get them properly mapped to each other.
(Now, the 6809, which had both better support for the direct/zero page and memory indirection, did not have memory indirection on the direct/zero page. And that was kind of unfortunate, except I wonder how many more effective gates it would have required. I think it could have been shoe-horned into the index post-byte.
As it was, the 6809 only had, IIRC, about a thousand more gates than the 6502, and it could indirect through absolute variables or variables on the stack, so you didn't really feel the lack of indirection on the direct/zero page. Well, it would have made user page variables more convenient, but, again, with four actual indexable registers you still didn't feel it so much as on the 6800.)
>
> Groetjes Albert
> --
> Albert van der Horst, UTRECHT,THE NETHERLANDS
> Economic growth -- being exponential -- ultimately falters.
Economic growth only has to be exponential when it is only the exponential growth that is accepted as meaningful. And that's why you picked that quote for a siggy, right?
> albert@spe&ar&
c.xs4all.nl &=n
http://home.hccnet.nl/a.w.m.van.der.horst