Bernie wrote:
>
> Clarence wrote:
>
> >A number is a number and no matter what name you give to it, it is still
> >the same number of apples:
>
> Not really, how much (in an unsigned integer) is "-1" apple(s)?
Any accountant would tell you -1 apples means you owe him one. ;-)
> This
> depends on the size of the variable/register that holds it. And there's no
> octal, binary or hexadecimal for that ;-)
Actually there is, if you are intimate with the machine. And it is number
system independant since these numbers are just translations of the binary
reality. Set your accumulator to zero. All zeros, any length. Subtract one.
The result is always all ones (any length) and the carry bit (borrow) is 1.
A -1 byte is 1 11111111 in binary, 1 FF in hex, 1 377 in octal etc.
> Yes, I'm "cheating" and no the teachers at university didn't like using
> signs like this.
See, I can cheat as well. <G>
> >eg 10 Decimal, 0A Hexadecimal, 12 Octal and 1010 binary all describe the
> >exact same number of widgets.
>
> It's worth to note that there are a few standardized ways to display the
> numbers.
Well, I personally think it is much better to not confuse this issue with
arbitrary and variable syntax rules for a beginner.
Let's just call them what they are. <g>
> Decimal has no change to it, so 10 means ten
> Hexadecimal has either an H (sometimes small) behind it (0AH), 0x infront
> (0x0A) or $ infront ($0A). 0x is used mostly by C programmers and UNIX
> users, as a DOS user you should use H to fit in. I have no idea what for
> instance Windows users use, but they probably never use such complex things :/
> Octal has a 0 as it's first number, so 0111 means 7 (or read, write and
> execute if you speak linux rights fluently <g>)
> And for binary a b is often added (00100000b), additionally a colon is
> often added to make it easier to convert into hexadecimal (0010:0000 =
> 0x20) and this often dropps the b.
You forgot the most common hexadecimal display: Just two hex characters.
See a debug listing or dump. <g>
- Clarence Verge
--
- Help stamp out FATWARE. As a start visit: http://home.arachne.cz/
- The internet is infected - Windows is a VIRUS !!
--