Sujet : Re: Why VAX Was the Ultimate CISC and Not RISC
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.archDate : 12. Mar 2025, 09:57:19
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Mar12.095719@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : xrn 10.11
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
One of the early programming languages I came across was POP-2. This was
fully dynamic and heap-based, like Lisp, but also had an operand stack. So
a simple assignment statement looked like
>
a -> b;
>
but this could actually be written as two separate statements:
>
a;
-> b;
>
The first one pushed the value of a on the stack, the second one popped it
off and stored it in b.
>
This made it easy to do things like swap variable values:
>
a, b -> a -> b;
In Forth you can define VALUEs that work like these POP-11 variables.
In standard Forth you can write
3 value a
5 value b
a b to a to b \ swaps the contents of a and b
a . b . \ print a and b
In some Forth systems you can write it in a syntax even closer to that
of POP:
On VFX Forth you can write:
a b -> a -> b
In Gforth (development version) you can write
a b ->a ->b
That's all not very idiomatic, though. VARIABLEs (which push their
address rather than their value) are more popular than VALUEs, but
usage such as the following is also not idiomatic; you usually use
variables (and values) sparingly.
variable a 3 a !
variable b 5 b !
a @ b @ a ! b !
a @ . b @ .
- anton
-- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>