<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 12pt; font-family: Verdana,Geneva,sans-serif'>
<p>Thanks Chris, that's interesting. I explored some combinations in blackbox:</p>
<p><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">MODULE Test; IMPORT Out;</span></p>
<p><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">PROCEDURE Do*;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">VAR b: BYTE; s: SHORTINT; i: INTEGER; l: LONGINT;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">BEGIN</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> i := 0FFFFFFFFH; Out.String("i := 0FFFFFFFFH: "); Out.Int(i,1); Out.Ln;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> l := 0FFFFFFFFH; Out.String("l := 0FFFFFFFFH: "); Out.Int(l,1); Out.Ln;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> l := 0FFFFFFFFL; Out.String("l := 0FFFFFFFFL: "); Out.Int(l,1); Out.Ln;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> l := 0FFFFFFFFFFFFFFFFL; Out.String("l := 0FFFFFFFFFFFFFFFFL: "); Out.Int(l,1); Out.Ln;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> (* The following all fail to compile with 'number too large': </span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> b := 0FFH;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> s := 0FFFFH;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> i := 0FFFFFFFFL;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> l := 0FFFFFFFFFFFFFFFFH;</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> *)</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">END Do;</span></p>
<p><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;">END Test.</span></p>
<p>With results:</p>
<p><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> i := 0FFFFFFFFH: -1</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> l := 0FFFFFFFFH: -1</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> l := 0FFFFFFFFL: 4294967295</span><br /><span style="font-family: 'courier new', courier, monospace; font-size: 10pt;"> l := 0FFFFFFFFFFFFFFFFL: -1</span></p>
<p>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.</p>
<p>Do you know if there is any way to enable e.g. FF for bytes, or FFFF for shortints? Or whether this was considered?</p>
<p>Thanks -- Dave.</p>
<p><br /></p>
<p>On 2020-04-26 12:32, Chris Burrows wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored --><!-- meta ignored -->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">FYI Oberon microsystems tackled this problem in the following way when 64-bit integers were introduced in their Component Pascal language:<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">"Hexadecimal integer constants now can be specified either as 4 byte (e.g., 0FFFFFFFFH) or 8 byte<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">constants (e.g., 0FFFFFFFFFFFFFFFFL). This allows to distinguish negative <em>INTEGER </em>hex<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">constants from positive <em>LONGINT </em>hex constants. For example, 0FFFFFFFF denotes -1 when<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">interpreted as <em>INTEGER</em>, but 4294967295 when interpreted as a <em>LONGINT</em>.<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">Integer constants are always <em>INTEGER </em>(4 byte) values. Assignment of an integer constant to a<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">smaller type (e.g., <em>BYTE</em>) is legal if the constant lies within the range of the target type. Integer<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">constants of other types can only be constructed using <em>SHORT </em>or <em>LONG</em>, except that sufficiently<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">large constants automatically have type <em>LONGINT</em>."<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">Ref: What's New in Component Pascal, Cuno Pfister, Oberon microsystems, Inc. March 2001<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"><!-- o ignored --> </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 ignored --></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 ignored --></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" target="_blank" rel="noopener noreferrer">https://www.astrobe.com</a><!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"><!-- o ignored --> </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"><strong><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';">From:</span></strong><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"> Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] <strong>On Behalf Of </strong>dave@brownsmeet.com<br /><strong>Sent:</strong> Sunday, 26 April 2020 8:12 PM<br /><strong>To:</strong> ETH Oberon and related systems<br /><strong>Subject:</strong> Re: [Oberon] Negative integer literals in Oberon<!-- o ignored --></span></p>
</div>
</div>
<p class="MsoNormal"><!-- o ignored --> </p>
<p><span style="font-family: 'Verdana','sans-serif';"><!-- o ignored --> </span></p>
<p><span style="font-family: 'Verdana','sans-serif';">To be clear - I would like VOC to allow myint32 := 90909090H, but VOC's support of 64 bit literals gets in the way.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">My advice therefore is that if you never plan to support integers of more than 32 bits, go ahead and allow myint := 90909090H.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">If you plan to add support for 64 bit integers later, you will need to work around the problems I described below. I cannot see how to do that, but I would love a solution.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">-- Dave.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">On 2020-04-26 10:14, Joerg wrote:<!-- o ignored --></span></p>
<blockquote style="border: none; border-left: solid #1010FF 1.5pt; padding: 0cm 0cm 0cm 5.0pt; margin-left: 0cm; margin-right: 0cm;">
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">In earlier Oberon versions, variable integer size was supported: INTEGER and LONGINT. LONGINT is not officially supported in Oberon-07 but the compiler internally declares TYPE LONGINT = INTEGER. <!-- o ignored --></span></p>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">The concept of variable integer size is not supported in Oberon-07 anymore. Every INTEGER has one (implementation dependent) size, be it 16 or 32 or 64 or ...<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">Syntactically and conceptionally, negative literals do not exist. Only results of calculations can be negative as they are done signed per report.<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">CONST neg = -1; is conceptionally the result of subtracting the literal 1 from 0, and NOT the literal -1.<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">If you use the hex suffix H to fill up the bits of the underlying INTEGER, you need to know the INTEGER size and are per definition in the grey, non-portable, implementation-dependent area of coding<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">If you use the hex suffix H to specify a (unsigned) 32 bit value for low level modules that work with 32 bits (on disc or memory or so) the size of the INTEGER does not matter (as long as it's 32 bits or larger of course) as your low level module have to treat the passed values MOD 100000000H anyhow.<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"><!-- o ignored --> </span></p>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">br<!-- o ignored --></span></p>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">Jörg<!-- o ignored --></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"><br /><br /><!-- o ignored --></span></p>
<blockquote style="border: none; border-left: solid #1010FF 1.5pt; padding: 0cm 0cm 0cm 5.0pt; margin-left: 0cm; margin-right: 0cm;">
<p class="MsoNormal" style="margin-bottom: 12.0pt;"><span style="font-family: 'Verdana','sans-serif';">Am 26.04.2020 um 10:25 schrieb Joerg <<a href="mailto:joerg.straube@iaeth.ch">joerg.straube@iaeth.ch</a>>:<!-- o ignored --></span></p>
</blockquote>
</div>
<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: 'Verdana','sans-serif';">Chris <!-- o ignored --></span></p>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">1) b := i; is allowed, right?<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">2) b := i; does not generate a range check, right?<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">3) i := 511; b := i; <!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">If 3) doesn't generate a range check, but you want to be compliant to the report, you implement the assignment as b := i MOD 256;<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">as any value MOD 256 is between 0..255.<!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">br<!-- o ignored --></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">Jörg<!-- o ignored --></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"><br /><br /><!-- o ignored --></span></p>
<blockquote style="border: none; border-left: solid #1010FF 1.5pt; padding: 0cm 0cm 0cm 5.0pt; margin-left: 0cm; margin-right: 0cm;">
<p class="MsoNormal" style="margin-bottom: 12.0pt;"><span style="font-family: 'Verdana','sans-serif';">Am 26.04.2020 um 09:28 schrieb <a href="mailto:dave@brownsmeet.com">dave@brownsmeet.com</a>:<!-- o ignored --></span></p>
</blockquote>
</div>
<blockquote style="border: none; border-left: solid #1010FF 1.5pt; padding: 0cm 0cm 0cm 5.0pt; margin-left: 0cm; margin-right: 0cm;">
<div>
<p><span style="font-family: 'Verdana','sans-serif';">((Lapsed) VOC maintainer here.)<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">In both VOC and Oberon 2013, integer literals are parsed in the symbol parser (VOC :OPS.Mod or 2013:ORS.MOD) and stored in the symbol table as signed integer values.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">Later, during expression compilation, their size is determined by the magnitude of their signed integer value.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">The difference between Oberon 2013 and VOC is the largest integer type, which is 32 bit on Oberon 2013 and 64 bit in VOC.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">The special handling that allows a hex literal with top bit set to be treated as a signed value happens at the time the literal is parsed as a symbol independent of what context it is being used in. (Consider e.g. 'CONST mask = 90909090H' - CONST parsing does not know whether this constant will be used in a 64 bit, 32 bit, 16bit or other context.)<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">VOC and Oberon 2013 do both allow the hex special case top bit set parsing behaviour, the difference being the integer literal size.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">Thus VOC accepts myint64 := 9090909090909090H because 9090909090909090H is parsed as a negative 64 bit signed integer.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">But VOC does not accept myint32 := 90909090H because 90909090H is parsed as a positive 64 bit signed integer. <!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">VOC has no way to parse 90909090H as a negative 32 bit signed integer.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';"> - I did wonder about adding a further suffix letter to indicate the intended size, but I couldn't satisfy myself that any solution was simple enough to be easy to understand.<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';"> - Note that this is independent of VOC's -Ox compatibility setting: that sets the default INTEGER size, not integer literal size - integer literals always support the largest available integer size which is SYSTEM.INT64 aka HUGEINT.)<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';">-- Dave<!-- o ignored --></span></p>
<p><span style="font-family: 'Verdana','sans-serif';"><!-- o ignored --> </span></p>
<p><span style="font-family: 'Verdana','sans-serif';">On 2020-04-25 22:52, Chris Burrows wrote:<!-- o ignored --></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" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">It all depends on what size (i.e. number of bits) INTEGER is defined as on the system you are using as to what range of numbers are valid INTEGERs. Since 2011, the range of INTEGER values is no longer defined in the Language Report; it is implementation-dependent. </span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"> </span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">In the Project Oberon (2013) RISC5 compiler, INTEGER is 32 bit so 90909090H is a valid INTEGER. Maybe you used the default (-O2) option in VOC? If so, INTEGER is 16 bit so 90909090H would be too large. Make sure you are compiling with the VOC –OC option instead if you want INTEGER to be treated as a 32 bit quantity.</span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"> </span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">Note that 9090H would be a negative number on a 16-bit INTEGER system but a positive number on a 32-bit INTEGER system.</span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"> </span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">Regards,</span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">Chris Burrows</span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;">CFB Software</span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"><a href="https://www.astrobe.com" target="_blank" rel="noopener noreferrer">https://www.astrobe.com</a></span><!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-language: EN-US;"> </span><!-- o ignored --></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" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';">From:</span></strong><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"> Oberon [<a href="mailto:oberon-bounces@lists.inf.ethz.ch">mailto:oberon-bounces@lists.inf.ethz.ch</a>] <strong><span style="font-family: 'Calibri','sans-serif';">On Behalf Of </span></strong>Arthur Yefimov<br /><strong><span style="font-family: 'Calibri','sans-serif';">Sent:</span></strong> Sunday, 26 April 2020 12:38 AM<br /><strong><span style="font-family: 'Calibri','sans-serif';">To:</span></strong> <a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a><br /><strong><span style="font-family: 'Calibri','sans-serif';">Subject:</span></strong> [Oberon] Negative integer literals in Oberon</span><!-- o ignored --></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">While developing the compiler[1], we got a question<!-- o ignored --></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; margin-bottom: 12.0pt;">whether it is possible to write the following:<!-- o ignored --></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">PROCEDURE DWord(n: INTEGER);<br />...<br />DWord (90909090H)<!-- o ignored --></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><br />(where INTEGER is 32-bit).<br /><br />Some compilers give an error (i.e. VOC), while this works in the<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">Project Oberon (2013) compiler. This would turn out to be quite convenient,<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">because the purpose of DWord in our code was to write 4 bytes to the file<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">given as INTEGER (using little-endian byte order).<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">DWord has the following implementation (module Generator[2]):<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><br />PROCEDURE DWord (n: INTEGER);<br />BEGIN<br /> Files.Write (r, CHR (n MOD 100H));<br /> Files.Write (r, CHR (n DIV 100H MOD 100H));<br /> Files.Write (r, CHR (n DIV 10000H MOD 100H));<br /> Files.Write (r, CHR (n DIV 1000000H))<br />END DWord;<br /><br />The Oberon language report does not indicate that literal 90909090H<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">should be considered an error if INTEGER has 32 bits.<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><br />In this experiment, an online RISC emulator[3] was used.<!-- o ignored --></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">References:<!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">[1] <a href="https://github.com/kekcleader/oberon" target="_blank" rel="noopener noreferrer">https://github.com/kekcleader/oberon</a><!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">[2] <a href="https://github.com/kekcleader/oberon/blob/master/Mod/Generator.Mod" target="_blank" rel="noopener noreferrer">https://github.com/kekcleader/oberon/blob/master/Mod/Generator.Mod</a><!-- o ignored --></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">[3] <a href="http://schierlm.github.io/OberonEmulator/emu-wasm.html?image=FullDiskImage&width=1024&height=768" target="_blank" rel="noopener noreferrer">http://schierlm.github.io/OberonEmulator/emu-wasm.html?image=FullDiskImage&width=1024&height=768</a><!-- o ignored --></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"><!-- o ignored --> </span></p>
<div>
<p class="MsoNormal"><span style="font-family: 'Courier New';">--<br /><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br /><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank" rel="noopener noreferrer">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><!-- o ignored --></span></p>
</div>
</blockquote>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';">--<br /><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br /><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank" rel="noopener noreferrer">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><!-- o ignored --></span></p>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><span style="font-family: 'Verdana','sans-serif';"><!-- o ignored --> </span></p>
<div>
<p class="MsoNormal"><span style="font-family: 'Courier New';">--<br /><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br /><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank" rel="noopener noreferrer">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><!-- o ignored --></span></p>
</div>
</blockquote>
</div>
</div>
<!-- html ignored --><br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">--<br /> <a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br /> <a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank" rel="noopener noreferrer">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a></div>
</blockquote>
</body></html>