Standalone BootLoader format
Hi, Just inspecting standalone Oberon format for 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. ORP.Compile @ ORTool.DecObj (* produces this disassembly *) 0 E7000007 B 7 1 00000000 MOV R0 R0 R0 2 00000000 MOV R0 R0 R0 3 00000000 MOV R0 R0 R0 4 00000000 MOV R0 R0 R0 5 00000000 MOV R0 R0 R0 6 00000000 MOV R0 R0 R0 7 00000000 MOV R0 R0 R0 8 4D000000 MOV SB R0 0 ... 36 40000000 MOV R0 R0 0 37 C7000000 B R0 entries: 32 What is the purpose of 7 words (7*4=28 bytes), that is branched over? Why 32 entries? - Tomas Kral <thomas.kral@email.cz>
Please have a look at how the code accesses your global variables x, y, z? Jörg Gesendet von Mail für Windows 10 Von: Tomas Kral Gesendet: Dienstag, 12. Mai 2020 10:06 An: Oberon@lists.inf.ethz.ch Betreff: [Oberon] Standalone BootLoader format Hi, Just inspecting standalone Oberon format for 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. ORP.Compile @ ORTool.DecObj (* produces this disassembly *) 0 E7000007 B 7 1 00000000 MOV R0 R0 R0 2 00000000 MOV R0 R0 R0 3 00000000 MOV R0 R0 R0 4 00000000 MOV R0 R0 R0 5 00000000 MOV R0 R0 R0 6 00000000 MOV R0 R0 R0 7 00000000 MOV R0 R0 R0 8 4D000000 MOV SB R0 0 ... 36 40000000 MOV R0 R0 0 37 C7000000 B R0 entries: 32 What is the purpose of 7 words (7*4=28 bytes), that is branched over? Why 32 entries? - Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Tomas Sorry, forget my comment. My comment is only true, if your standalone module happens to run at address 0. Standalone modules normally reside in ROM. I don’t why ORP.Module sets dc := 8 to leave space for 7 entries. br Jörg Gesendet von Mail für Windows 10 Von: Jörg Straube Gesendet: Dienstag, 12. Mai 2020 11:04 An: ETH Oberon and related systems Betreff: Re: [Oberon] Standalone BootLoader format Please have a look at how the code accesses your global variables x, y, z? Jörg Gesendet von Mail für Windows 10 Von: Tomas Kral Gesendet: Dienstag, 12. Mai 2020 10:06 An: Oberon@lists.inf.ethz.ch Betreff: [Oberon] Standalone BootLoader format Hi, Just inspecting standalone Oberon format for 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. ORP.Compile @ ORTool.DecObj (* produces this disassembly *) 0 E7000007 B 7 1 00000000 MOV R0 R0 R0 2 00000000 MOV R0 R0 R0 3 00000000 MOV R0 R0 R0 4 00000000 MOV R0 R0 R0 5 00000000 MOV R0 R0 R0 6 00000000 MOV R0 R0 R0 7 00000000 MOV R0 R0 R0 8 4D000000 MOV SB R0 0 ... 36 40000000 MOV R0 R0 0 37 C7000000 B R0 entries: 32 What is the purpose of 7 words (7*4=28 bytes), that is branched over? Why 32 entries? - Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Tue, 12 May 2020 12:52:21 +0200 Jörg Straube <joerg.straube@iaeth.ch> wrote:
I don’t why ORP.Module sets dc := 8 to leave space for 7 entries.
Actually I boot it with SW[0] on, at address 0, then. When I add 3 more dummy variables, a, b, c. It still jumps over 7 words, while SB goes from 0 to 16 (0 to 8 with x, y, z only). So the gap of 7 words is not a placeholder for globals, probably? When I compile the same code with Oberon-0 compiler on risc, and arm (OSPX...), I got this respectively, (* risc *) 0 4EE90004 SUB SP SP 4 1 AFE00000 STW LNK SP 0 2 40000000 MOV R0 R0 0 ... 31 8FE00000 LDW LNK SP 0 32 4EE80004 ADD SP SP 4 33 C700000F B LNK (* arm *) 0 E7000000 B 0 1 40000000 MOV R0 R0 0 ... 26 40000000 MOV R0 R0 0 27 C7000000 B R0 On arm it jumps to the next instruction word. While on risc it has different sequence, but boots and count leds as well on real h/w. -- Tomas Kral <thomas.kral@email.cz>
participants (2)
-
Jörg Straube -
Tomas Kral