[Oberon] Assumed issue in the Lola-2 compiler
rochus.keller at bluewin.ch
rochus.keller at bluewin.ch
Mon Apr 15 02:18:12 CEST 2019
Thank you once more for your feedback.
@ Paul Reed:
>> if x=-1, then I would assume the result of this assignment would be zero.
>> Unfortunately, yes.
Ok, then DIV is not a useful operator for this case. I therefor changed the REPEAT statement like this:
REPEAT d[i] := x MOD 10H;
x := ASR(x,4); (* 'x DIV 16' corresponds to ASR(x,4) *)
INC(i)
UNTIL (x = 0) OR (i = 8);
I did a couple of tests and think it works as expected. Does this look reasonable to you?
@ Joerg Straube:
I hope you don't mind if I respond in English ;-)
Thanks for the minimized MOD expressions; I will do some tests with them. Currently I assume that my Oberon to C++ translator will just insert _MOD() funktion calls and not prescribe the implementation. I agree that the language report is rather brief and more information would be helpful. But the ' length specification is explicitly mentioned in the text which for me is sufficient to support it; and the reason I spent the effort with the Oberon to C++ translator was that I can use the original Lola compiler source code. It is also easier to recognize the literals in the generated Verilog code if the format doesn't change too much.
Best
R.K.
More information about the Oberon
mailing list