<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>It is useful that Blackbox reports those compilation errors; it is less forgiving than many Oberon compilers. By not making assumptions it forces the programmer to really think about what he is trying to achieve. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>As far as I know there are no specific literal constants defined in Component Pascal for BYTE or SHORTINT values. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>If I were you I would implement two completely separate compilers. One that implements 32-bit INTEGERs and another that implements 64-bit INTEGERs and avoid mixing the two. In that way you can still conform to the Oberon Language report and not have to introduce any extensions. If you are concerned that a programmer might want to write code using the 64-bit compiler and then try to run it on the 32-bit compiler that is a problem for the programmer not you. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>If the programmer is writing code that he wants to run on both systems then he should separate any parts that are sensitive to the size of INTEGER and include assertions in those parts such as:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>ASSERT(SYSTEM.SIZE(INTEGER) = 8)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>to prevent it from accidentally being compiled for, and run on, the wrong platform.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Chris Burrows<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>CFB Software<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><a href="https://www.astrobe.com">https://www.astrobe.com</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> dave@brownsmeet.com [mailto:dave@brownsmeet.com] <br><b>Sent:</b> Sunday, 26 April 2020 11:23 PM<br><b>To:</b> chris@cfbsoftware.com; ETH Oberon and related systems<br><b>Subject:</b> Re: [Oberon] Negative integer literals in Oberon<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p><span style='font-family:"Verdana","sans-serif"'>Thanks Chris, that's interesting. I explored some combinations in blackbox:<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>MODULE Test; IMPORT Out;</span><span style='font-family:"Verdana","sans-serif"'><o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>PROCEDURE Do*;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'>VAR b: BYTE; s: SHORTINT; i: INTEGER; l: LONGINT;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'>BEGIN</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> i := 0FFFFFFFFH; Out.String("i := 0FFFFFFFFH: "); Out.Int(i,1); Out.Ln;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> l := 0FFFFFFFFH; Out.String("l := 0FFFFFFFFH: "); Out.Int(l,1); Out.Ln;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> l := 0FFFFFFFFL; Out.String("l := 0FFFFFFFFL: "); Out.Int(l,1); Out.Ln;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> l := 0FFFFFFFFFFFFFFFFL; Out.String("l := 0FFFFFFFFFFFFFFFFL: "); Out.Int(l,1); Out.Ln;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> (* The following all fail to compile with 'number too large': </span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> b := 0FFH;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> s := 0FFFFH;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> i := 0FFFFFFFFL;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> l := 0FFFFFFFFFFFFFFFFH;</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> *)</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'>END Do;</span><span style='font-family:"Verdana","sans-serif"'><o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'>END Test.</span><span style='font-family:"Verdana","sans-serif"'><o:p></o:p></span></p><p><span style='font-family:"Verdana","sans-serif"'>With results:<o:p></o:p></span></p><p><span style='font-size:10.0pt;font-family:"Courier New"'> i := 0FFFFFFFFH: -1</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> l := 0FFFFFFFFH: -1</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> l := 0FFFFFFFFL: 4294967295</span><span style='font-family:"Verdana","sans-serif"'><br></span><span style='font-size:10.0pt;font-family:"Courier New"'> l := 0FFFFFFFFFFFFFFFFL: -1</span><span style='font-family:"Verdana","sans-serif"'><o:p></o:p></span></p><p><span style='font-family:"Verdana","sans-serif"'>So I understand the H/L suffix enables the use of hex bit patterns for 32 and 64 bit integers, but does not address the issue for 8 or 16 bit integers.<o:p></o:p></span></p><p><span style='font-family:"Verdana","sans-serif"'>Do you know if there is any way to enable e.g. FF for bytes, or FFFF for shortints? Or whether this was considered?<o:p></o:p></span></p><p><span style='font-family:"Verdana","sans-serif"'>Thanks -- Dave.<o:p></o:p></span></p><blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm'><div><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p></div></blockquote></div></div></body></html>