[Oberon] Left / Right vs Positive / Negative shifts

Chris Burrows chris at cfbsoftware.com
Sat Dec 9 05:17:04 CET 2017


> 
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Jorg Straube
> Sent: Saturday, 9 December 2017 1:57 PM
> To: ETH Oberon and related systems
> Subject: Re: [Oberon] Project Oberon color
> 
> From Texts.Load:
> q.voff := ASR(LSL(bt, -24), 24);
> 
> Thats the "standard" way to upscale a signed 8bit vale to a signed
> 32bit value??
> It's equivalent to
> IF bt<127 THEN q.voff := bt ELSE q.voff := bt-256 END;
> 

That may well have been the intention but that is not the result. The problem is that 

  LSL(bt, -24) 

should be 

  LSL(bt, 24)

or, possibly,

  ROR(bt, -24) 

if that was what the author was thinking of.

Regards,
Chris Burrows
CFB Software
http://www.astrobe.com/RISC5










More information about the Oberon mailing list