[Oberon] FPGA Oberon some news and a reply to F.P.
eas lab
lab.eas at gmail.com
Sat Mar 15 15:17:59 CET 2014
]> PASCAL / Modula / Oberon were never intended to directly access bytes
]> in absolute-addressed memory
> Modula-2 was. It can address hardware addresses, eg video RAM using
> VAR screen [0B000H:0] : ARRAY .. , .. OF RECORD ch, at : CHAR END;
> To mention just one. It also has low level functions that come close
> to assembler. From the trio Pascal / Modula / Oberon, Modula-2 is the
> one best suited for operating system design. It has all the potential and
> the functions. It also has the dreaded LOOP/END construct that is the
> heart of all operating system inner loops. compared to which a minimal
> assembler..etc. would be trivial. FST Modula for DOS had the assembler
> built-in. It was very convenient. One of the better Modula-2 variants.
Perhaps Modula-2 was the peak of 'or family', and the contiual name change
lost followers?
]> I used: #N->A , directly as the syntax.
> Why not " A := N " ? That would have been readable and understandable
> by all.
No! When you looked in the data-sheets, to see "what means: mov rA,N",
They used the '#N->regA' notation.
poplog uses "a + b -> c" instead of "a := b + c", which IMO is better:
<ID> := <expression> is goal-directed/ declarative / top-down;
whereas our Algol-family is imperative: NOT "let a = b + c".
OTOH: <expression> ":=" <ID> loses the one-token-look-ahead parsing
ability to identify an assignment statement [as I discovered when I made
a FSM compiler based on the railway-diagrams].
============
> On the other hand I liked very much the means of Modula-2 to have a
> "high-level" way to do assembler stuff like the absolute address for
> variables you mentioned. Thus we introduced a similar construct to
> define variables and arguments as being in a register. E.g. if you
> wrote something like (R is a module that symbolically exports the
> M68000 registers)
> IMPORT R;
> PROCEDURE Swap(VAR a{R.A0},b{R.A1}:LONGINT);
> VAR temp{R.D0}:LONGINT;
> BEGIN
> temp:=a; a:=b; b:=temp
> END Swap;
> The generated code for Swap would be
> MOVE.L (A0),D0
> MOVE.L (A1),(A0)
> MOVE.L D0,(A1)
> RTS
Vaguely I remember 'bracket' (A1) meaning 'indirect'?
Following each manufaturer's copyrighted syntax, is as absurd as writing
music in mock-english.
] Good point! Looking at the source code indicates to me that they are
] typos.
] I believe they should be:
] FML a, b, c R.a := R.b h R.c
] MUL a, b, n R.a := R.b h n
You get typos when you think in terms of 'writing near-english notes to the
little man in the box', instead of <symbolic>; like schematic diagrams or
music noation.
> And, worst of all, WHY would you want to fall back to mnemonics? Why do
> you need to use
> MOV 1, 2 (which looks stupid)
> when you can also use
> Load R1, 2 (which looks logical)
> or, even better:
> R1 := 2 (which leaves no doubt at all)
We 'know' it does NOT 'move' per english meaning. But the competition
copyrighted "load" or "copy".
> #N -> Ra
] This is more difficult to read (and parse) than a mnemonic followed by
] a fixed number of operands.
You mean for the computer/parser-writer.
] Keep it simple...
No, not simple for the parser-writer.
Simple for the zillion readers.
I haven't seen CPU data-sheets for a few decades, but even with the
greatly increase compexity, I doubt that they've replaced the symbolic
explanation with "poetry'.
> Try to eliminate any sort of pre-conceived ideas that you may have from
> using other systems. It might be a subtle distinction but the specification
> is not describing any sort of assembly language - it is describing the
> behaviour and format of the 32-bit binary codes that are emitted by the
> code generator. The compiler does not generate assembler. Project Oberon
> does not use any assembly language - all the code is Oberon.
Well, unless it's new magic:
* the subset of the 2^32 words are decoded by the hardware to give a
vocabulary of useful instructions, which manipulate the hardware
[eg. registers].
* when humans need to think about or exchange information on any
specific 'instruction' [in the vocabulary] they need a label for it.
* which leads to 'the assembly language'.
When humans DISCOVERED the elements, they needed to be named.
And the genes, also 'operated in the background' without being assigned
an assembly language; until you want to analyse/discuss them.
== Chris Glur.
More information about the Oberon
mailing list