[Oberon] RISC emulator

Jörg joerg.straube at iaeth.ch
Fri Mar 28 15:14:43 CET 2014


Hi

The main change I did was to use the same output formatting statements (the
thing with " ", "-" and digits) for the corner case and the normal case.
I left the test for the corner case as is.

There are different ways to test for the corner case
Whether you write 
  IF x = 80000000H THEN ...
or 
  IF ROR(x, 31) = 1 THEN ...
is up to your gusto and the capabilities of the compiler :-)

br
Jörg


-----Original Message-----
From: Paul Onyschuk [mailto:blink at bojary.koba.pl] 
Sent: Freitag, 28. März 2014 13:15
To: oberon at lists.inf.ethz.ch
Cc: ETH Oberon and related systems
Subject: Re: [Oberon] RISC emulator

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

--
Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6097 bytes
Desc: not available
Url : https://lists.inf.ethz.ch/pipermail/oberon/attachments/20140328/7f99595a/attachment.bin 


More information about the Oberon mailing list