[Oberon] Standalone BootLoader format

Tomas Kral thomas.kral at email.cz
Thu May 14 22:22:24 CEST 2020


On Thu, 14 May 2020 15:59:32 +0200
JR <joerg.straube at iaeth.ch> wrote:

> Are you sure, Close() is a good place to initialize SB?
> Try to find out, when your added instruction is executed.

This seems doing the work better.

  entry, fixlist (*not used*): LONGINT;

  PROCEDURE Header*(size: LONGINT);
  BEGIN entry := pc; fix(0, pc-1); Put1(Mov, SB, 0, 0)
  END Header;

  PROCEDURE Close*;
  BEGIN Put1(Mov, 0, 0, 0); Put3(0, 7, 0); fix(entry, pc*4)
  END Close;

It also makes StoreBoot simple, but needing two jumps.

  PROCEDURE StoreBoot*;
    VAR F: Files.File; R: Files.Rider; i: INTEGER;
  BEGIN
    F := Files.New("Risc.bin"); Files.Set(R, F, 0);
    Texts.WriteString(W, "store Risc.bin");
    Files.WriteInt(R, 0E7000007H); (* B 7 *)
    FOR i := 1 TO 7 DO Files.WriteInt(R, 0H) END ; (* reserved *)
    i := 0; REPEAT Files.WriteInt(R, code[i]); INC(i)
    UNTIL i = pc; Files.Register(F);
    Texts.WriteString(W, " done.");
    Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf)
  END StoreBoot;

-- 
Tomas Kral <thomas.kral at email.cz>


More information about the Oberon mailing list