[net.arch] 1802 Bogosity

cdshaw@watdragon.UUCP (Chris Shaw) (03/21/86)

In article <10693@amdcad.UUCP>, tim@amdcad.UUCP (Tim Olson) writes:
> ...  The 1802 certainly had some interesting concepts
> for its time, however.

Yeah.

My favorite bit was the lack of stack push instruction (or a stack pop 
instruction.. depends on which way you grow stack). Instead, what you had
was two instructions: "load, then increment" and "store, then decrement"
where the load or store address was a register, and the register then got 
incremented or decremented. In any event, because these two instructions
are not symmetric opposites, you must leave one as is, and make a 2-instruction
macro which does (for example) "decrement, then store". 

UNLESS YOU HAVE INTERRUPTS!! Because if you got interrupted in the middle
of this "push" macro, your stack would corrupt: possibly one of the hardest-to-
find bugs in existence !!! (I was forewarned by an old 1802 hand, but all the
same, it's not something that helped me sleep nights).

On the other hand, 16 general purpose registers were nice, and once you got used
to it, you could do anything. In fact, I found it very easy to write
a p-code interpreter for Pascal.. I just defined 4 or 5 of the regs as "mine"
and I had a very simple p-machine. God help you if you ran out of registers,
though. If you didn't save a register for a spill address, once you filled up 
all your registers, you were screwed blue. (I believe.. this didn't 
happen to me). I actually find this machine easier to understand & program 
than the 6502 with its chintzy 8-bit index-offset-meta-coke-bottle 
addressing modes.

As far as 32-bit version.. don't be silly. The only people who use 1802's are
the military and aeronautics, because it's in CMOS and has remained unchanged 
and therefore chip-bugless since the mid 70's. 

Also, the 1802 is one of those chips anyone with a little
hardware expertise and a spec. could design in an afternoon using just 
plain TTL MSI parts. The 1802 is like one of those see-through drawings
of engines you see in mechanic books: obvious as hell how things work
if you think about it.

Chris Shaw    watmath!watrose!cdshaw  or  cdshaw@watmath
University of Waterloo
Bogus as HELL !!!