[Oberon] Standalone BootLoader format

Tomas Kral thomas.kral at email.cz
Tue May 12 16:45:52 CEST 2020


>    2   00000000  MOV  R0  R0  R0       ; code[2], ADR(code[2]) =
> ADR(x)

Apologies, this not clear. As in the code and assembly I can see.

MODULE* Counter;
  VAR x, y, z: INTEGER;
BEGIN LED(1); z := 0;
  REPEAT LED(z); x := 1000;
     REPEAT y := 1000;
       REPEAT y := y-1 UNTIL y = 0;
       x := x-1
     UNTIL x = 0;
     z := z+1
   UNTIL FALSE
END Counter.

   0     E7000007       B       7
   1     00000000       is this SB addr 0?
   2     00000000
   3     00000000
   4     00000000
   5     00000000
   6     00000000
   7     00000000
(* Static base SB points to addr 0 *)
   8     4D000000       MOV SB  R0      0
   9     5E00FFC0       MOV SP  R0    -64
(* LED(1), mem[-60] := 1*)
  10     40000001       MOV  R0  R0      1
  11     5100FFC4       MOV  R1  R0    -60
  12     A0100000       STR   R0  R1       0
(* z := 0, mem[SB+8] := R0 *)
  13     40000000       MOV  R0  R0      0
  14     A0D00008       STR   R0 SB       8
...
(* y := 1000, mem[SB+0] := R0 *)
  18     400003E8       MOV  R0  R0   1000
  19     A0D00000       STR   R0 SB       0
(* x := 1000, mem[SB+4] := R0 *)
  20     400003E8       MOV  R0  R0   1000
  21     A0D00004       STR   R0 SB       4
...

If more VARs added, e.g. 
VAR x, y, z, a, b, c: INTEGER;
a := 0; b := 0; c := 0;

Compiled, and then, there is still only 7 words to branch over???

I have also though that those 7 words are to do with boot area limits
set by BootLoader at boot time.

EDIT
See PO2013 Applications, page 74.

 0 A branch instruction to the initializing body of module Modules
12 The limit of available memory
16 The address of the end of the module space loaded
20 The current root of the links of loaded modules
24 The current limit of the module area

Quite confused, can you please explain?
Many thanks

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


More information about the Oberon mailing list