[Oberon] FPGA Oberon some news and a reply to F.P.
Claudio Nieder
private at claudio.ch
Tue Mar 4 12:57:02 CET 2014
Hi,
> FST Modula for DOS had the assembler built-in. It was very convenient.
> One of the better Modula-2 variants.
Though with M2Amiga I came to feel an integrated Assembler, as useful as it is in certain situation, can also distract a programmer of overusing it. At the time we prepared Version 4.0 a new author jumped into the team and implemented such integrated Assembler, and used it then in the compiler itself in the attempt to speed it up. After quite some effort he put in he had to admit, that the benefit he got out of the exercise was quite disappointing.
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
which meant that knowing a little about the compiler would give you exactly the assembler code you wanted. Again you shouldn't overdue because once you alias a variable with a register it is no more available to the compiler for storing its intermediate values and the compiler would complain with a "not enough registers" error message.
> But it also means that Oberon remains an island in
> an ocean of PC hardware, no matter how ridiculous that PC hardware may be.
This is the always present double edged sword. Do you want to adapt to the world or do you want to create your own world. In the first case you benefit from many helping hands but the outcome is not exactly what you want it to be. In the second case you rule, but you can manage just as much as you can with your own resources. Do you create your own HW fulfilling exactly your needs or do you profit from Intels weird, but every year speedier processors. Do you write your own device drivers in Oberon or do you profit from Linux and just put your TUI on top of it. Do you write your applications in Oberon or do you switch to C because this gives you access to a lot of libraries so you need to write less yourself?
And the answer to this question is that there is no general answer. It depends on each one's individual goals which approach is appropriate.
claudio
--
Claudio Nieder, Talweg 6, CH-8610 Uster, Tel +4179 357 6743, www.claudio.ch
More information about the Oberon
mailing list