[Oberon] Doubt on code generated with Oberon Simulator.

Joerg joerg.straube at iaeth.ch
Wed Jul 13 09:06:56 CEST 2016


Srinivas

You probably ran into the problem of not having unloaded the old compiler.
In previous code, ORG.New looked like this:
  ... Put3(BLR, 7,MT);… (* without the position of the source code *)

The latest version of ORG.New looks like this
  … Trap(7, 0); … (* with the position of the source code *)

If you want to test freshly compiled compiler, you first have to unload the old still loaded compiler with
   System.Free ORP ORG ORB ORS ~

Jörg


> Am 13.07.2016 um 04:08 schrieb Srinivas Nayak <sinu.nayak2001 at gmail.com>:
> 
> Hmmm...
> 
> I should have mentioned the "easy way to check it" for everybody.
> 
> [latest = 4 July 2016]
> - take the latest compiler code and build the compiler
> - take the latest Files.Mod.txt and compile it with your new compiler
> - take the Files.rsc file out to Linux.
> - hexdump -v -s 199 -e '1/4 "%08.8X " "\n"' Files.rsc > Files.rsc.orig.hex
> - Check line 156, 188, 273, 361 ...
> 
> 
> With thanks and best regards,
> 
> Yours sincerely,
> Srinivas Nayak
> 
> Home: http://www.mathmeth.com/sn/
> Blog: http://srinivas-nayak.blogspot.in/
> 
> On 07/12/2016 09:06 PM, Srinivas Nayak wrote:
>> Dear All,
>> 
>> I use Peter De Wachter's Oberon Simulator on Linux.
>> I took the latest compiler code from www.projectoberon.com.
>> I compiled the latest compiler (ORS, ORB, ORG, ORP).
>> Using the latest compiler, I compiled latest Files.Mod.txt.
>> It gave Files.rsc.
>> 
>> Now I see, Files.Mod.txt has 8 calls to NEW().
>> [1st NEW at pos=3022, 2nd NEW at pos=3241, 3rd NEW at pos=3592, ...]
>> 
>> ORG.Mod.txt says,
>> 
>>   PROCEDURE New*(VAR x: Item);
>> 
>>   BEGIN loadAdr(x); loadTypTagAdr(x.type.base); Trap(7, 0); RH := 0; invalSB
>> 
>>   END New;
>> 
>> 
>>   PROCEDURE Trap(cond, num: LONGINT);
>> 
>>   BEGIN Put3(BLR, cond, ORS.Pos()*100H + num*10H + MT)
>> 
>>   END Trap;
>> 
>> 
>> It seems, from inside Trap(), compiler should generate the opcode
>> 0xD70BCE0C (Pos*256+num*16+MT = 3022*256+0*16+12 = 0x0BCE0C)
>> 0xD70CA90C (Pos*256+num*16+MT = 3241*256+0*16+12 = 0x0CA90C)
>> 0xD70E080C (Pos*256+num*16+MT = 3592*256+0*16+12 = 0x0E080C)
>> ...
>> 
>> However, Files.rsc contains only
>> 0xD700000C
>> 0xD700000C
>> 0xD700000C
>> ...
>> 
>> That means, Trap will not be able to report the position at run time!
>> 
>> I have no real Oberon hardware.
>> Kindly let me know if your latest Files.rsc contains only 0xD700000C corresponding to each NEW or not.
>> I shall be grateful, if I can get the latest Files.rsc from the latest native Oberon.
>> [By latest native Oberon, I mean FPGA Oberon update of 4 July 2016 running on real FPGA hardware.]
>> 
>> 
>> 
>> With thanks and best regards,
>> 
>> Yours sincerely,
>> Srinivas Nayak
>> 
>> Home: http://www.mathmeth.com/sn/
>> Blog: http://srinivas-nayak.blogspot.in/
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list