<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=4&amp;t=3779" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2009-08-11T18:30:08+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=4&amp;t=3779</id>
<entry>
<author><name><![CDATA[i-Bot]]></name></author>
<updated>2009-08-10T22:34:52+01:00</updated>
<published>2009-08-10T22:34:52+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21242#p21242</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21242#p21242"/>
<title type="html"><![CDATA[Byte operations]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21242#p21242"><![CDATA[
Even though a BYTE variable, Robobasic first does the maths at 16 bits, so 255(0000 0000 1111 1111b) + 3(0000 0000 0000 00011b) = 258(0000 0001 0000 0010b). This is truncated to 8 bits when the variable is stored again as a BYTE, giving the value 2(0000 0010b).<br /><br />For the subtract 0(0000 0000 0000 0000b) - 3(0000 0000 0000 0010) = 65533( C 1111 1111 1111 1101) note carry bit is set. This is truncated and carry bit ignored to give  a BYTE of 253(1111 1101).<br /><br />How did you check it ? the compiler may limit input values to 0 to 255, but the above is the way the maths is done when it is executed.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=159">i-Bot</a> — Mon Aug 10, 2009 10:34 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[RoboJeronimo]]></name></author>
<updated>2009-08-11T18:30:08+01:00</updated>
<published>2009-08-10T19:26:38+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21239#p21239</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21239#p21239"/>
<title type="html"><![CDATA[Byte operations]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21239#p21239"><![CDATA[
I check it again, with SERVO instruction.<br /><br />var=255+3<br />SERVO 6, var<br /><br />The variable is circular<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1554">RoboJeronimo</a> — Mon Aug 10, 2009 7:26 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2009-08-06T10:40:01+01:00</updated>
<published>2009-08-06T10:40:01+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21162#p21162</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21162#p21162"/>
<title type="html"><![CDATA[Byte operations]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21162#p21162"><![CDATA[
A byte is usually considered to be unsigned 8 bit number i.e. 0-255.  <br /><br />If you have an 8 bit signed integer the actual number range is -128 to 127.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Thu Aug 06, 2009 10:40 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[TheJuggler]]></name></author>
<updated>2009-08-06T18:17:35+01:00</updated>
<published>2009-08-06T02:19:17+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21152#p21152</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21152#p21152"/>
<title type="html"><![CDATA[Byte operations]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21152#p21152"><![CDATA[
That's all assuming that the byte is unsigned.<br /><br />If it's signed then when you add 3 to 255, you'll get a negative number, and likewise when you subtract 3 from 0 you'll get -3.  (although 255 isn't really possible since there are only 7 bits available for data meaning that you can get a max of 127.)<br /><br />But if it's signed, then the maximum value is 127, as the most significant bit will be the sign bit.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1569">TheJuggler</a> — Thu Aug 06, 2009 2:19 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[RoboJeronimo]]></name></author>
<updated>2009-08-05T20:52:58+01:00</updated>
<published>2009-08-05T20:52:58+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21144#p21144</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21144#p21144"/>
<title type="html"><![CDATA[Byte operations]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21144#p21144"><![CDATA[
So the secuencie is:<br /><br /><span style="font-weight: bold">...253 - 254 - 255 - 0 - 1 - 2 - 3...</span><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1554">RoboJeronimo</a> — Wed Aug 05, 2009 8:52 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[NovaOne]]></name></author>
<updated>2009-08-05T20:17:00+01:00</updated>
<published>2009-08-05T20:17:00+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21142#p21142</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21142#p21142"/>
<title type="html"><![CDATA[Byte operations]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21142#p21142"><![CDATA[
DIM var AS BYTE <br />var=255<br />var=var+3<br /><br />So var = 2<br /><br />DIM var AS BYTE <br />var=0<br />var=var-3<br /><br />So var = 253<br /><br />Is this wrong?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=663">NovaOne</a> — Wed Aug 05, 2009 8:17 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[RoboJeronimo]]></name></author>
<updated>2009-08-05T17:57:01+01:00</updated>
<published>2009-08-05T17:57:01+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21136#p21136</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21136#p21136"/>
<title type="html"><![CDATA[Byte operations]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=3779&amp;p=21136#p21136"><![CDATA[
Hi,<br /><br />What are the result of...<img src="http://forum.robosavvy.com/images/smilies/icon_question.gif" alt=":?:" title="Question" /> <br /><br />DIM var AS BYTE   'max value=255 isn't it?<br />var=255<br /><span style="font-weight: bold">var=var+3</span><br />-------------------------------------------------------<br />DIM var AS BYTE   'min value=0 isn't it?<br />var=0<br /><span style="font-weight: bold">var=var-3</span><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1554">RoboJeronimo</a> — Wed Aug 05, 2009 5:57 pm</p><hr />
]]></content>
</entry>
</feed>