Hardware Reference
In-Depth Information
anyway. In some cases, one of the operands is not mentioned. For example, in the
MULB instruction, only the AX register is powerful enough to act as a destination.
There are also a number of one-operand instructions, such as increments,
shifts, negates, etc. In these cases, there is no register requirement, and the differ-
ence between the word and byte operations has to be inferred from the opcodes
(i.e., instruction types) only.
The 8088 supports four basic data types: 1-byte byte, the 2-byte word, the
4-byte long , and binary coded decimal , in which two decimal digits are packed
into a word. The latter type is not supported by the interpreter.
A memory address always refers to a byte, but in case of a word or a long, the
memory locations directly above the indicated byte are implicitly referred to as
well. The word at 20 is in the memory locations 20 and 21. The long at address
24 occupies the addresses 24, 25, 26 and 27. The 8088 is little endian, meaning
that the low-order part of the word is stored at the lower address. In the stack seg-
ment, words should be placed at even addresses. The combination AX DX , in which
AX holds the low-order word, is the only provision made for longs in the processor
registers.
The table of Fig. C-3 gives an overview of the 8088 addressing modes. Let us
now briefly discuss them. The topmost horizontal block of the table lists the regis-
ters. They can be used as operands in nearly all instructions, both as sources and
as destinations. There are eight word registers and eight byte registers.
The second horizontal block, data segment addressing, contains addressing
modes for the data segment. Addresses of this type always contain a pair of paren-
theses, to indicate that the contents of the address instead of the value is meant.
The easiest addressing mode of this type is direct addressing , in which the data
address of the operand is in the instruction itself. Example
ADD CX,(20)
in which the contents of the memory word at address 20 and 21 is added to CX .
Memory locations are usually represented by labels instead of by numerical values
in the assembly language, and the conversion is made at assembly time. Even in
CALL and JMP instructions, the destination can be stored in a memory location
addressed by a label. The parentheses around the labels are essential (for the
assembler we are using) because
ADD CX,20
is also a valid instruction, only it means add the constant 20 to CX , not the contents
of memory word 20. In Fig. C-3, the # symbol is used to indicate a numerical con-
stant, label, or constant expression involving a label.
In register indirect addressing, the address of the operand is stored in one of
the registers BX , SI ,or DI .
In all three cases the operand is found in the data
 
Search WWH ::




Custom Search