<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial'; COLOR: #000000">
<DIV><SPAN class=_Tgc>Why is there no arithmetic right shift operation in
Modula-3 ?</SPAN></DIV>
<DIV><SPAN class=_Tgc></SPAN> </DIV>
<DIV><SPAN class=_Tgc>Oberon software has a clever way to minimally
encode</SPAN></DIV>
<DIV><SPAN class=_Tgc>signed integers independently of their size.</SPAN></DIV>
<DIV><SPAN class=_Tgc></SPAN> </DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas>PROCEDURE WriteInt (i: INTEGER)
=</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas> BEGIN</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas> WHILE x < –64 OR
x > 63 DO</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas> Write
(VAL (i MOD 128 + 128, CHAR));</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas> i := i
DIV 128;</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas>
END;</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas> Write (VAL (i MOD
128), CHAR));</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Consolas> END Write;</FONT></SPAN></DIV>
<DIV><SPAN class=_Tgc><FONT face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=_Tgc>Unfortunately it is impossible to implement the
corresponding</SPAN></DIV>
<DIV><SPAN class=_Tgc>decoder in M3, because it requires an arithmetic right
shift</SPAN></DIV>
<DIV><SPAN class=_Tgc>where the sign bit is replicated into the left
end.</SPAN></DIV></DIV></DIV></BODY></HTML>