[Oberon] Fighting a dragon ...

Hans Klaver hklaver at dds.nl
Fri Jul 12 22:18:47 CEST 2024


Hi Jörg,

Thanks for your prompt reply.

On 11 July 2024 you wrote:

> From the screenshots you provided I assume you are using Peter de Wachter’s emulator.

Yes, I tested (in macOS) using both Peter De Wachter's emulator and Michael Schierl's enhanced emulator (a fork of PdW's). Both give the same results. The Windows version of Michael's emulator gives these same results as well.

I almost forgot that I also have the 'Oberon Workstation' emulator for macOS (version 1.3.2., implemented in Swift) by Roel de Jong, presumably the one you use. Today I used that Oberon RISC emulator for the TestDragon commands, and both commands give correct output for x2; moreover the problem with the rendering of even ordered dragons does not occur, even with the original Math.Mod (which, as you know, has a not very good implementation of Math.ln). 

This confirms your suspicion that a bug in the emulator and not in the compiler is the culprit. 

It was silly of me to mention OBNC in this context because I discovered that OBNC transpiles Oberon's REAL type to 64-bit floating point (in C), so it is not a fair comparison.

You also wrote:

> I think I found the error in PdW’s emulator:
>  
> The Verlog line in FPAdder.v
>     xn ? (u|yn ? 0 : y) : 
>  
> got translated in fp_add() to
> } else if (xn) {
>     return (u | yn) ? 0 : y;
>  
> but should be
>   } else if (xn) {
>     return (u || yn) ? 0 : y;

I downloaded a fresh oberon-risc-emu-master.zip for Peter De Wachter's emulator and patched the file risc-fp.c in it (dated 18-8-2020) with your proposed solution. 

After building the emulator unfortunately the test commands TestDragon.Correct and TestDragon.Incorrect gave the same output as in the unpatched emulators, also when using the improved version of Math.ln.

So I'm afraid your proposal is not the whole solution...

Regards,

Hans



More information about the Oberon mailing list