I read a book which called assembly64
and can be found here, now it says that - A byte (8-bits) can be used to represent 256 different numbers, a word (16-bits) can be used to represent 65,536 different values, and a double-word (32-bits) can be used to represent 4,294,967,296 different numbers. So, if you wanted to store a value of 100,000 then a double-word would be required.
I don't under what does represent x different values mean? I know that a character is 1 byte and 256 is intended to be the ASCII table, but I didn't understand the following line - a word (16-bits) can be used to represent 65,536 different values, what's is the 65,536 values mean?
If you have a data type that can store the values
0
and1
, it can store two different values.Thus, "represents x different values" means that, if you start from 0, it can store integers up to
x - 1
. That said, numbers are often signed, so the maximum is lower and the minimum is negative.To find the maximum unsigned value given the number of bits, the calculation is
2^n - 1
ifn
is the number of bits.On page 36 of the document you linked (direct link), there's a table that details the possible values that can be stored in each data type, signed and unsigned.