MIC Ch 3
MIC Ch 3
Microprocessors (22415)
Page 1 of 6
Program: Computer Engineering
Microprocessors (22415)
Operation: Flags affected < ----- AL/AX-ES: 5. Describe any 6 addressing modes of
[DI] 8086 with one example each.
It compares a byte or word in AL/AX with a
byte /word pointed by ES: DI. 1. Immediate addressing mode:
The string to be scanned must be in the extra An instruction in which 8-bit or 16-bit
segment and pointed by DI. CX contains operand (data) is specified in the instruction,
counter and DF may be 0 or 1. then the addressing mode of such instruction
When the match is found in the string is known as
execution stops and ZF=1 otherwise Immediate addressing mode.
ZF=0. Example:
Example MOV AX,67D3H
LEA DI, destination 2. Register addressing mode
MOV Al, 0DH An instruction in which an operand (data) is
MOV CX, 80H specified in general purpose registers, then
CLD the addressing mode is known as register
REPNE SCASB addressing mode.
5] LODS/LODSB/LODSW: Example: MOV AX,CX
Load String byte into AL or Load String word 3. Direct addressing mode
into AX. An instruction in which 16 bit effective address
Syntax: of an operand is specified in the instruction,
LODS/LODSB/LODSW then the addressing mode of such instruction
Operation: AL/AX < ----- DS: [SI] is known as direct addressing mode.
It copies a byte or word from string pointed Example: MOV CL,[2000H]
by SI in data segment into AL or AX.CX 4. Register Indirect addressing mode
may contain the counter and DF may be either An instruction in which address of an operand
0 or 1 is specified in pointer register or in index
Example register or in BX, then the addressing mode is
LEA SI, destination known as register indirect addressing mode.
CLD Example: MOV AX, [BX]
LODSB 5. Indexed addressing mode
6] STOS/STOSB/STOSW (Store Byte or An instruction in which the offset address of
Word in AL/AX) an operand is stored in index registers (SI or
Syntax STOS/STOSB/STOSW DI) then the addressing mode of such
Operation: ES:[DI] < ----- AL/AX instruction is known as indexed addressing
It copies a byte or word from AL or AX to a mode.
memory location pointed by DI DS is the default segment for SI and DI.
in extra segment For string instructions DS and ES are the
default segments for SI and DI resp. this is a
special case of register indirect addressing
mode.
Page 3 of 6
Program: Computer Engineering
Microprocessors (22415)
Page 4 of 6
Program: Computer Engineering
Microprocessors (22415)
address of the first address of the first Syntax: RCR destination, count
word word Eg:
RCR BL, 1; Rotate all bits in BL right by 1 bit,
copy LSB to CF and CF
ROL RCL
Rotate left byte or Rotate through carry 9.Differentiate RCL and RCR instructions
word left byte or on the basis of
word (i) Syntax
Syntax: ROL Syntax: RCL (ii) Operation
Destination, Count Destination, Count (iii) Example
Can be used to Swap (iv) Status of carry flag
the nibbles Cannot be
used to swap the
nibbles
Page 5 of 6
Program: Computer Engineering
Microprocessors (22415)
Page 6 of 6