Hardware Reference
In-Depth Information
Mode
Operand
Examples
Register addressing
Byte register
Byte register
AH,AL,BH,BL,CH,CL,DH,DL
Word register
Word register
AX,BX,CX,DX,SP,BP,SI,DI
Data segment addressing
Direct address
Address follows opcode
(#)
Register indirect
Address in register
(SI), (DI), (BX)
Register displacement
Address is register+displ.
#(SI), #(DI), #(BX)
Register with index
Address is BX + SI/DI
(BX)(SI), (BX)(DI)
Register index displacement
BX + SI DI + displacement
#(BX)(SI), #(BX)(DI)
Stack segment address
Base Pointer indirect
Address in register
(BP)
Base pointer displacement
Address is BP + displ.
#(BP)
Base Pointer with index
Address is BP + SI/DI
(BP)(SI), (BP)(DI)
Base pointer index displ.
BP+SI/DI + displacement
#(BP)(SI), #(BP)(DI)
Immediate data
Immediate byte/word
Data part of instruction
#
Implied address
Push/pop instruction
Address indirect ( SP )
PUSH, POP, PUSHF, POPF
Load/store flags
status flag register
LAHF, STC, CLC, CMC
Translate XLAT
AL, BX
XLAT
Repeated string instructions
(SI), (DI), (CX)
MOVS, CMPS, SCAS
In / out instructions
AX, AL
IN #, OUT #
Convert byte, word
AL, AX, DX
CBW,CWD
Figure C-3. Operand addressing modes. The symbol # indicates a numerical val-
ue or label.
segment. It is also possible to put a constant in front of the register, in which case
the address is found by adding the register to the constant. This type of addressing,
called register displacement , is convenient for arrays. If, for example, SI contains
5, then the fifth character of the string at the label FORMAT can be loaded in AL by
MOVB AL,FORMAT(SI).
The entire string can be scanned by incrementing or decrementing the register in
each step. When word operands are used, the register should be changed by two
each time.
It is also possible to put the base (i.e., lowest numerical address) of the array in
the BX register, and keep the SI or DI register for counting. This is called register
with index addressing. For example:
PUSH (BX)(DI)
fetches the contents of the data segment location whose address is given by the
 
Search WWH ::




Custom Search