[Oberon] FPGA - Screen.Mod

Tomas Kral thomas.kral at email.cz
Sun Sep 17 12:04:35 CEST 2017

Hi Paul,

Making first steps with `Screen.Grab', the code compiles and does
things, however bits are not reversed as intended, they appear as if
mirrored, on my RPI platform.

I have recoded reversing part as follows, not sure if better or faster,
but the output is identical to shifting and masking inner loop, though
both not correct for RPI.

(*little endian: high, low words*)
hwd := bits MOD 10000H; lwd := bits DIV 10000H;

(*big endian: high, low bytes*)
bits := (lwd DIV 100H)*1000000H +
        (lwd MOD 100H)*10000H +
        (hwd DIV 100H)*100H +
        (hwd MOD 100H);
Files.WriteInt(R, bits)


Also looking for Files.WriteInt for inspiration.

PROCEDURE WriteInt*(VAR R: Rider; x: INTEGER);
BEGIN WriteByte(R, x MOD 100H);
  WriteByte(R, x DIV 100H MOD 100H);
  WriteByte(R, x DIV 10000H MOD 100H);
  WriteByte(R, x DIV 1000000H MOD 100H)
END WriteInt;

Many thanks.

Tomas Kral <thomas.kral at email.cz>

More information about the Oberon mailing list