[Oberon] FPGA - Oberon-0 program

Paul Reed paulreed at paddedcell.com
Sun Oct 22 01:15:15 CEST 2017


Hi Tomas,

Please don't "cc" me, just post to the list - thanks.


> code generated TestO[b]eron0 617 44

Great!  That's what I get too.  But it seems there's some updating to do -
I do apologise, the module IO is missing (see below).

I think your "module not found" message was actually:

Call error: IO module not found

which means that it is the module IO which is not found, not TestOberon0.

Each Oberon-0 I/O operation which used to be handled by the RISC emulator,
e.g. WriteInt(), is now handled natively, by an inline call to module IO
(see, for example, OSG.WriteInt).  So you couldn't proceed without the
IO.Mod source code; I'm very sorry for any inconvenience.

Also I noticed that OSG.FixLink doesn't have a call to invalSB (compare
with the full compiler) so please add one.  I'll get the website updated
as soon as I can.

Cheers,
Paul


MODULE IO;   (*for Oberon0   NW 29.4.2017*)
  IMPORT Texts,Oberon;
  VAR S: Texts.Scanner;  W: Texts.Writer;

  PROCEDURE OpenInput*;
  BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S)
  END OpenInput;

  PROCEDURE ReadInt*(VAR x: LONGINT);
  BEGIN x := S.i;  Texts.Scan(S)
  END ReadInt;

  PROCEDURE Class*(): INTEGER;
  BEGIN RETURN S.class
  END Class;

  PROCEDURE Write*(ch: CHAR);
  BEGIN Texts.Write(W, ch)
  END Write;

  PROCEDURE WriteInt*(x: LONGINT; n: INTEGER);
  BEGIN Texts.WriteInt(W, x, n)
  END WriteInt;

  PROCEDURE WriteLn*;
  BEGIN Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf)
  END WriteLn;

BEGIN Texts.OpenWriter(W)
END IO.




More information about the Oberon mailing list