Working with Binary

Last example - the number 543 converts into a 10-bit number. As the Beeb stores numbers in whole bytes, that equates to a 2-byte number as two bits from a second byte are required to store the number. With judicious programming and use of operands to extract individual bits from bytes like we saw with AND earlier, it would be possible to use the remaining 6 bits of the second byte to store some other data, so that a 10-bit number and a further 6-bit number, or a combination of bit flags and numbers, could be stored only using two bytes.

Click here to return to Binary