Bits and Bytes – why look at ASM programming

This section quickly covers some of the elementary concepts about data, the CPU, and general programming. An experienced programmer may want to skip this section.

BITS AND BYTES

When programming in Assembly language, it is necessary to know about bits, bytes, and words. A bit is the smallest element of information that can be addressed. A single bit can only be programmed as either zero or one; therefore, it cannot convey much information. A group of eight bits linked together make one byte. With eight bits linked together, you can represent the numbers from zero to 255 or 256 combinations. If the high bit of a byte is used to identify a number as positive or negative, then you can represent the numbers ä128 to +127. When the high bit of the byte is used as a positive/negative flag, then the number is said to be signed. This is noted because some instructions will use either signed or unsigned logic. Two 8-bit bytes are linked together to make one 16-bit word. For 16 bits, you can represent the numbers from zero to 65535. The 8086 is classified as a 16-bit processor. Most of the registers are 16 bit with some registers that can also be addressed in 8-bit modes. Most of the operations are word or byte oriented. A signed word can range from ä32768 to +32767. A double word is 32 bits which is equal to two words or four bytes.
BIT |X| (X can be either 0 or 1)
BYTE |X|X|X|X|X|X|X|X|
WORD |X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| Continue reading “Bits and Bytes – why look at ASM programming”