[Oberon] Assumed issue in the Lola-2 compiler

rochus.keller at bluewin.ch rochus.keller at bluewin.ch
Mon Apr 15 13:06:15 CEST 2019

@ Paul Reed

Thanks for the additions.

>> what's not specifically defined in the Oberon language 
>> report is normally intentionally left undefined

The language report states: "The operators DIV and MOD apply to integer operands only. Let q = x DIV y, and r = x MOD y.
Then quotient q and remainder r are defined by the equation x = q*y + r [with] 0 <= r < y."

Assuming standard mathematics this specification is complete but I could not deduce "-1 DIV 16 = -1" from it. Or did I miss something?

>> suggest looking at how the Oberon RISC compiler generates 
>> code, as the easiest route.

It's hard to belief that the easiest route to get a full language specification is to learn RISC5 assembler and to read the code generator for this assembler ;-)
There must be a more "regular" way otherwise I would consider the language heavily underspecified. Maybe we can start like this: is the "-1 DIV y = -1" the only exception where the DIV operator deviates from standard mathematics? If yes this can easily be covered by a condition.


More information about the Oberon mailing list