<aname="l17"></a>Variables are declared as certain <u>types</u>. There are types for numbers. You just saw two of them above, I64 and U8.
<aname="l18"></a>
<aname="l19"></a>The compiler gives us 8 types for numbers. These types are different <u>sizes</u> of numbers, and if they are <u>signed</u> or <u>unsigned</u>.
<aname="l20"></a>
<aname="l21"></a>A <u>byte</u> is 8 bits. The range of numbers you can store in a byte is 0 to 255. In a signed byte that range is from -128 to 127.
<aname="l22"></a>
<aname="l23"></a>* Unsigned types cannot be a negative value.
<aname="l24"></a>* Only signed types can store negative numbers.
<aname="l25"></a>
<aname="l26"></a>Now you might be thinking, how does it know if a number is negative or not? After all, a number is just a series of bits!
<aname="l27"></a>
<aname="l28"></a>The way we store a signed number is we reserve a single bit in the number to tell us whether or not it is signed.
<aname="l29"></a>
<aname="l30"></a>If we have a number that is 8 bits wide, then we have to use a single bit as a <u>sign bit</u>.
<aname="l31"></a>The sign bit is always the highest bit available.
<aname="l32"></a>
<aname="l33"></a>In a signed byte, bits #0-6 will be used to store the actual value of the number.
<aname="l34"></a>
<aname="l35"></a>Bit #7 will be the sign bit. If the sign bit is 1, then it is a negative number.
<aname="l62"></a></span><spanclass=cF1>U8</span><spanclass=cF0> -- </span><spanclass=cFE>1</span><spanclass=cF0> byte (</span><spanclass=cFE>8</span><spanclass=cF0> bits) unsigned number
<aname="l63"></a></span><spanclass=cF1>I8</span><spanclass=cF0> -- </span><spanclass=cFE>1</span><spanclass=cF0> byte (</span><spanclass=cFE>8</span><spanclass=cF0> bits - </span><spanclass=cFE>1</span><spanclass=cF0> sign bit = </span><spanclass=cFE>7</span><spanclass=cF0> bits) signed number
<aname="l65"></a></span><spanclass=cF9>U16</span><spanclass=cF0> -- </span><spanclass=cFE>2</span><spanclass=cF0> byte (</span><spanclass=cFE>16</span><spanclass=cF0> bits) unsigned number
<aname="l66"></a></span><spanclass=cF9>I16</span><spanclass=cF0> -- </span><spanclass=cFE>2</span><spanclass=cF0> byte (</span><spanclass=cFE>16</span><spanclass=cF0> bits - </span><spanclass=cFE>1</span><spanclass=cF0> sign bit = </span><spanclass=cFE>15</span><spanclass=cF0> bits) signed number
<aname="l68"></a></span><spanclass=cF9>U32</span><spanclass=cF0> -- </span><spanclass=cFE>4</span><spanclass=cF0> byte (</span><spanclass=cFE>32</span><spanclass=cF0> bits) unsigned number
<aname="l69"></a></span><spanclass=cF9>I32</span><spanclass=cF0> -- </span><spanclass=cFE>4</span><spanclass=cF0> byte (</span><spanclass=cFE>32</span><spanclass=cF0> bits - </span><spanclass=cFE>1</span><spanclass=cF0> sign bit = </span><spanclass=cFE>31</span><spanclass=cF0> bits) signed number
<aname="l71"></a></span><spanclass=cF9>U64</span><spanclass=cF0> -- </span><spanclass=cFE>8</span><spanclass=cF0> byte (</span><spanclass=cFE>64</span><spanclass=cF0> bits) unsigned number
<aname="l72"></a></span><spanclass=cF9>I64</span><spanclass=cF0> -- </span><spanclass=cFE>8</span><spanclass=cF0> byte (</span><spanclass=cFE>64</span><spanclass=cF0> bits - </span><spanclass=cFE>1</span><spanclass=cF0> sign bit = </span><spanclass=cFE>63</span><spanclass=cF0> bits) signed number
<aname="l77"></a>Declare a I8 variable named 'x' and assign(=) it the value 3, and press ENTER.
<aname="l78"></a>
<aname="l79"></a></span><spanclass=cF1>C:/Home></span><spanclass=cF2>I8 x = 3;</span><spanclass=cF0>
<aname="l80"></a>
<aname="l81"></a>Now type </span><spanclass=cF2>Bts(&x, 7);</span><spanclass=cF0> and press ENTER. This will set bit #7 to 1. Bts is "Bit test and set". Don't forget the </span><spanclass=cF2>&</span><spanclass=cF0>.
<aname="l82"></a>
<aname="l83"></a>Now if you want to see the value of x, you can simply type </span><spanclass=cF2>x;</span><spanclass=cF0> and press ENTER.