[Oberon] RISC emulator

Paul Onyschuk blink at bojary.koba.pl
Fri Mar 28 13:14:40 CET 2014

On Fri, 28 Mar 2014 22:01:30 +1030
Chris Burrows <chris at cfbsoftware.com> wrote:
>   IF ROR(x, 31) = 1 ...
> The test should only return true if bit 31 of x is 1 *and* all the
> other bits of xare zero. 
> When you are doing low-level bit-manipulation operations like this,
> low-level bit-manipulation operators like ROR are quite suitable.

Is there particular reason why absolute value isn't checked instead:
  x0 := -x;
  IF x0 < 0 THEN ...

This is also integer-size agnostic.  I'm asking since this looks like a
proper way of checking for the same corner case when using ABS():

  IF (ABS(x) < 0) THEN ...
  ELSE ...

Hope I'm not too intrusive with this question.

Paul Onyschuk

More information about the Oberon mailing list