<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>INC is defined on INTEGER values, not Word.T.</div><div><br></div><div>I think your problem is somewhere else.</div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><font class="Apple-style-span" color="#0000FF"><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Antony Hosking</span></span></font></font><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-converted-space"> </span>|<span class="Apple-converted-space"> </span></span></span><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Office</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 |<span class="Apple-converted-space"> </span></span></span></font><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Mobile</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><br class="khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="Apple-interchange-newline"></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On 20 Jan 2010, at 21:52, Jay K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>I'll look into it again.<br>There's definitely a problem somewhere.<br> Maybe in my change. Maybe.<br><br><br>Using TInt.Multiply vs. TWord.Multiply made the difference<br>between INC() incrementing by zero or the correct amount.<br>I had some number, I multiplied it by a variable<br>that also happened to be 1, and I got zero.<br>This was the only problem I ran into in changing<br>from INTEGER to Target.Int.<br><br><br> - Jay<br><br>________________________________<br><blockquote type="cite">From: <a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br></blockquote><blockquote type="cite">Date: Wed, 20 Jan 2010 20:00:39 -0500<br></blockquote><blockquote type="cite">To: <a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br></blockquote><blockquote type="cite">CC: <a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a>; <a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a>; <a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br></blockquote><blockquote type="cite">Subject: Re: [M3devel] [M3commit] m3back using Target.Int in place of INTEGER a lot now<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Jay, I don't know what you are talking about there being a bug in TWord.Multiply.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This little program prints out 2, as would be expected:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">MODULE Main;<br></blockquote><blockquote type="cite">IMPORT RTIO, TInt, TWord, Target;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">VAR i := TInt.Two;<br></blockquote><blockquote type="cite">j: Target.Int;<br></blockquote><blockquote type="cite">buf: ARRAY[0..10] OF CHAR;<br></blockquote><blockquote type="cite">BEGIN<br></blockquote><blockquote type="cite">TWord.Multiply (i, TInt.One, j);<br></blockquote><blockquote type="cite">FOR k := 0 TO TInt.ToChars (i, buf) DO<br></blockquote><blockquote type="cite">RTIO.PutChar(buf[k]);<br></blockquote><blockquote type="cite">END;<br></blockquote><blockquote type="cite">RTIO.PutChar('\n');<br></blockquote><blockquote type="cite">RTIO.Flush();<br></blockquote><blockquote type="cite">END Main.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 20 Jan 2010, at 18:59, Tony Hosking wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Where's the bug in TWord.Multiply?<br></blockquote><blockquote type="cite">If there were a bug we would have seen it by now surely?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Antony Hosking | Associate Professor | Computer Science | Purdue University<br></blockquote><blockquote type="cite">305 N. University Street | West Lafayette | IN 47907 | USA<br></blockquote><blockquote type="cite">Office +1 765 494 6001 | Mobile +1 765 427 5484<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 20 Jan 2010, at 10:05, Jay K wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This is fairly large and tedious. If anyone has the patience to look at every single line, please do. Thanks.<br></blockquote><blockquote type="cite">I did look through pretty much every single line in search of the one bug I saw working on it.<br></blockquote><blockquote type="cite">It turns out the bug was in TWord though. TWord.Multiply(x, 1) = 0.<br></blockquote><blockquote type="cite">Which broke INC, it was adding 0 instead 1.<br></blockquote><blockquote type="cite">You could see the bug in RTIO.PutString where it just kept outputing the first character.<br></blockquote><blockquote type="cite">So I use TInt.Multiply instead.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- Jay<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">________________________________<br></blockquote><blockquote type="cite">From: <a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br></blockquote><blockquote type="cite">To: <a href="mailto:jkrell@elego.de">jkrell@elego.de</a>; <a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br></blockquote><blockquote type="cite">Date: Wed, 20 Jan 2010 15:02:27 +0000<br></blockquote><blockquote type="cite">Subject: Re: [M3commit] CVS Update: cm3<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">diff attached<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Date: Wed, 20 Jan 2010 16:01:32 +0000<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">To: <a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">From: <a href="mailto:jkrell@elego.de">jkrell@elego.de</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Subject: [M3commit] CVS Update: cm3<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">CVSROOT: /usr/cvs<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Changes by: jkrell@birch. 10/01/20 16:01:32<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Modified files:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">cm3/m3-sys/m3back/src/: Codex86.i3 Codex86.m3 M3x86.m3<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">M3x86Rep.i3 Stackx86.i3 Stackx86.m3<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">cm3/m3-sys/m3middle/src/: TInt.i3 TInt.m3<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Log message:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">convert much of m3back to use Target.Int instead of INTEGER<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">This should at least allow it to propagate constant LONGINTs<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">as well as perhaps otherwise help with implementing LONGINT,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">since the virtual stack is now of Target.Int instead of INTEGER<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Beware that TWord.Multiply(x, 1) = 0, so I use TInt.Multiply instead<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Also note that there's still a lot of "INTEGER" used.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span> <span class="Apple-tab-span" style="white-space:pre">   </span>   <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>  <br></blockquote></div></blockquote></div><br></body></html>