You are on page 1of 21

10/14/2021

Microprocessor Instruction Set


 Instruction set:

 the basic set of commands or instructions that a


8086 Microprocessor Architecture microprocessor understands
(Instruction Set)  also called a command set or a group of commands

 Instruction set specifies a processor’s functionality

 what operations it supports

 what storage mechanisms it has & how they are accessed

 how the programmer/compiler communicates programs to

processor

2 8086 Architecture 10/14/2021

Microprocessor Instruction Set Overview of 8086 Instruction Set


 Instruction Set Architecture (ISA) is the structure of a computer  The 8086 instructions are categorized into the following main
that a machine language programmer (or a compiler) must types:
understand to write a correct program for that machine. ISA
 Data Copy / Transfer Instructions
includes:
 Arithmetic and Logical Instructions
 Native data types
 Branch Instructions
 Instructions

 Registers  Loop Instructions

 Addressing modes  Machine Control Instructions

 Memory architecture  Flag Manipulation Instructions


 Interrupt and exception handling  Shift and Rotate Instructions
 External I/O
 String Instructions

3 8086 Architecture 10/14/2021 4 8086 Architecture 10/14/2021

1
10/14/2021

Overview of 8086 Instruction Set… Overview of 8086 Instruction Set…


 Data Transfer(14)  String Manipulation(6)

 MOV, PUSH, POP, XCHG, IN, OUT, XLAT, LEA, LDS, LES, LAHF,  REP, MOVS, XMPS, SCAS, LODS, STOS

SAHF, PUSHF, POPF  Control Transfer(26)

 Arithmetic(20)  CALL, JMP, RET, JE/JZ, JL/JNGE, JLE/JNG, JB/JNAE, JBE/JNA,

 ADD, ADC, INC, AAA, BAA, SUB, SSB, DEC, NEG, CMP, AAS, JP/JPE, JO, JS, JNE/JNZ, JNL/JGE, JNLE/JG, JNB/JAE,
DAS, MUL, IMUL, AAM, DIV, IDIV, AAD, CBW, CWD JNBE/JA, JNP/JPO, JNO, JNS, LOOP, LOOPZ/LOOPE,

 Logic (12) LOOPNZ/LOOPNE, JCXZ, INT, INTO, IRETR

 NOT, SHL/SAL, SHR, SAR, ROL, ROR, RCL, RCR, AND, TEST,  Processor Control(12)

OR, XOR  CLC, CMC, STC, CLD, STD, CLI, STI, HLT, WAIT, ESC, LOCK,

NOP

5 8086 Architecture 10/14/2021 6 8086 Architecture 10/14/2021

Data Copy/Transfer Instructions Data Copy/Transfer Instructions…


 MOV :  MOV AX,50H[BX]
 copies a word or a byte of data from some source to a  MOV [734AH],BX

destination.  MOV DS,CX

 the destination can be a register or a memory location  MOV CL,[357AH]

 the source can be a register, a memory location, or an  direct loading of the segment registers with immediate data is
immediate number not permitted
 MOV AX,BX

 MOV AX,5000H

 MOV AX,[SI]

 MOV AX,[2000H]

7 8086 Architecture 10/14/2021 8 8086 Architecture 10/14/2021

2
10/14/2021

Data Copy/Transfer Instructions… Data Copy/Transfer Instructions…


 PUSH : Push to Stack

 pushes the contents of the specified register/memory


location on to the stack
 the stack pointer is decremented by 2, after each execution

of the instruction
 PUSH AX

 PUSH DS

 PUSH [5000H]

9 8086 Architecture 10/14/2021 10 8086 Architecture 10/14/2021

Data Copy/Transfer Instructions… Data Copy/Transfer Instructions…


 POP : Pop from Sack

 when executed loads the specified register/memory location

with the contents of the memory location of which the


address is formed using the current stack segment and stack
pointer
 The stack pointer is incremented by 2

 POP AX

 POP DS

 POP [5000H]

11 8086 Architecture 10/14/2021 12 8086 Architecture 10/14/2021

3
10/14/2021

Data Copy/Transfer Instructions… Data Copy/Transfer Instructions…


 XCHG : Exchange byte or word  IN:

 exchanges the contents of the specified source and  Copy a byte or word from specified port to accumulator

destination operands  IN AL,03H

 XCHG [5000H], AX  IN AX,DX

 XCHG BX, AX  OUT:

 XLAT :  Copy a byte or word from accumulator to a specified port

 Translate byte using look-up table  OUT 03H, AL

 LEA BX, TABLE1  OUT DX, AX

 MOV AL, 04H

 XLAT

13 8086 Architecture 10/14/2021 14 8086 Architecture 10/14/2021

Data Copy/Transfer Instructions… Data Copy/Transfer Instructions…


 LEA:  LES:

 Load effective address of operand in specified register  Load ES register and other specified register from memory

 [reg] offset portion of address in DS  [reg] [mem]

 LEA reg, offset  [ES] [mem + 2]

 LDS:  LES reg, mem

 Load DS register and other specified register from memory

 [reg] [mem]

 [DS] [mem + 2]

 LDS reg, mem

15 8086 Architecture 10/14/2021 16 8086 Architecture 10/14/2021

4
10/14/2021

Data Copy/Transfer Instructions… Data Copy/Transfer Instructions…


 Flag transfer instructions:  SAHF:

 LAHF  Store (copy) AH register to low byte of flag register.

 SAHF  [Flags low byte] [AH]

 PUSHF  SAHF

 POPF  PUSHF:

 Copy flag register to top of stack

 LAHF:  [SP] [SP] – 2

 Load (copy to) AH with the low byte of the flag register  [[SP]] [Flags]

 [AH] [ Flags low byte]  PUSHF

 LAHF

17 8086 Architecture 10/14/2021 18 8086 Architecture 10/14/2021

Data Copy/Transfer Instructions… Arithmetic Instructions


 POPF:  ADD:

 Copy word at top of stack to flag register.  adds the contents of the source operand to the destination

 [Flags] [[SP]] operand

 [SP] [SP] + 2  ADD AX, 0100H

 ADD AX, BX

 ADD AX, [SI]

 ADD AX, [5000H]

 ADD [5000H], 0100H

19 8086 Architecture 10/14/2021 20 8086 Architecture 10/14/2021

5
10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 ADC : Add with Carry  SUB : Subtract

 performs the same operation as ADD instruction, but adds  subtracts the source operand from the destination operand

the carry flag to the result and the result is left in the destination operand
 ADC 0100H  SUB AX, 0100H

 ADC AX, BX  SUB AX, BX

 ADC AX, [SI]  SUB AX, [5000H]

 ADC AX, [5000]  SUB [5000H], 0100H

 ADC [5000], 0100H

21 8086 Architecture 10/14/2021 22 8086 Architecture 10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 SBB : Subtract with Borrow  INC : Increment

 subtracts the source operand and the borrow flag (CF) which  increases the contents of the specified Register or memory

may reflect the result of the previous calculations, from the location by 1.
destination operand  Immediate data cannot be operand of this instruction

 SBB AX, 0100H  INC AX

 SBB AX, BX  INC [BX]

 SBB AX, [5000H]  INC [5000H]

 SBB [5000H], 0100H

23 8086 Architecture 10/14/2021 24 8086 Architecture 10/14/2021

6
10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 DEC : Decrement  NEG : Negate

 subtracts 1 from the contents of the specified register or  forms 2’s complement of the specified destination in the

memory location. instruction


 DEC AX  the destination can be a register or a memory location

 DEC [5000H]  This instruction can be implemented by inverting each bit

and adding 1 to it.


 NEG AL

 AL = 0011 0101 = 35H

 Replace number in AL with its 2’s complement

 AL = 1100 1011 = CBH

25 8086 Architecture 10/14/2021 26 8086 Architecture 10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 CMP : Compare  MUL :Unsigned Multiplication Byte or Word

 compares the source operand, which may be a register or an  multiplies an unsigned byte or word by the contents of AL

immediate data or a memory location, with a destination  MUL BH ; (AX) (AL) x (BH)
operand that may be a register or a memory location  MUL CX ; (CX)(AX) (AX) x (CX)
 CMP BX, 0100H  MUL WORD PTR [SI] ; (DX)(AX) (AX) x ([SI])
 CMP AX, 0100H

 CMP [5000H], 0100H

 CMP BX, [SI]

 CMP BX, CX

27 8086 Architecture 10/14/2021 28 8086 Architecture 10/14/2021

7
10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 IMUL :Signed Multiplication  CBW : Convert Signed Byte to Word

 multiplies a signed byte in source operand by a signed byte  copies the sign of a byte in AL to all the bits in AH

in AL or a signed word in source operand by a signed word in  AH is then said to be sign extension of AL.
AX  CBW
 IMUL BH  AX= 0000 0000 1001 1000
 IMUL CX  Convert signed byte in AL to signed word in AX
 IMUL [SI]  Result in AX = 1111 1111 1001 1000

29 8086 Architecture 10/14/2021 30 8086 Architecture 10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 CWD : Convert Signed Word to Double Word  DIV : Unsigned division

 This instruction copies the sign of a byte in AL to all the bits  used to divide an unsigned word by a byte or to divide an

in AH. AH is then said to be sign extension of AL unsigned double word by a word


 CWD  DIV CL ; Word in AX / byte in CL
 Convert signed word in AX to signed double word in DX : ; Quotient in AL, remainder in AH
AX  DIV CX ; Double word in DX and AX / word
 DX= 1111 1111 1111 1111 ; in CX, and Quotient in AX,
 Result in AX = 1111 0000 1100 0001 ; remainder in DX

31 8086 Architecture 10/14/2021 32 8086 Architecture 10/14/2021

8
10/14/2021

Arithmetic Instructions… AAA Example


 : ASCII Adjust After Addition

 isAAA executed after an ADD instruction that adds two ASCII


coded operand to give a byte of result in AL
 The AAA instruction converts the resulting contents of AL to a

unpacked decimal digits


 ADD CL, DL ; [CL] = 32H = ASCII for 2
; [DL] = 35H = ASCII for 5
; Result [CL] = 67H
 MOV AL, CL ; Move ASCII result into AL since
; AAA adjust only [AL]
 AAA ; [AL]=07, unpacked BCD for 7

33 8086 Architecture 10/14/2021 34 8086 Architecture 10/14/2021

AAA Example… AAA Example…

35 8086 Architecture 10/14/2021 36 8086 Architecture 10/14/2021

9
10/14/2021

AAA Example… AAA Example…

37 8086 Architecture 10/14/2021 38 8086 Architecture 10/14/2021

AAA Example… Arithmetic Instructions…


 AAS : ASCII Adjust AL after Subtraction

 corrects the result in AL register after subtracting two


unpacked ASCII operands
 the result is in unpacked decimal format

 the procedure is similar to AAA instruction except for the

subtraction of 06 from AL

39 8086 Architecture 10/14/2021 40 8086 Architecture 10/14/2021

10
10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 AAM : ASCII Adjust after Multiplication  AAD : ASCII Adjust before Division

 converts two unpacked BCD digits in AH and AL to the


 after execution, converts the product available in AL into
equivalent binary number in AL
unpacked BCD format
 this adjustment must be made before dividing the two unpacked
 MOV AL, 04 ; AL = 04 BCD digits in AX by an unpacked BCD byte
 MOV BL ,09 ; BL = 09  In the instruction sequence, this instruction appears before DIV
instruction
 MUL BL ; AX = AL*BL ; AX=24H
 AX 05 08
 AAM ; AH = 03, AL=06
 AAD result in AL 00 3A 58D = 3A H in AL

 The result of AAD execution will give the hexadecimal number


3A in AL and 00 in AH
 Where 3A is the hexadecimal equivalent of 58 (decimal).

41 8086 Architecture 10/14/2021 42 8086 Architecture 10/14/2021

Arithmetic Instructions… Arithmetic Instructions…


 DAA : Decimal Adjust Accumulator  DAS : Decimal Adjust after Subtraction

 used to convert the result of the addition of two packed BCD  converts the result of the subtraction of two packed BCD

numbers to a valid BCD number numbers to a valid BCD number


 the result has to be only in AL  the subtraction has to be in AL only

 AL = 53 CL = 29  AL = 75, BH = 46

 ADD AL, CL ; AL (AL) + (CL)  SUB AL, BH ; AL 2 F = (AL) - (BH)


; AL 53 + 29 ; AF = 1

; AL 7C  DAS ; AL 2 9 (as F>9, F - 6 = 9)


 DAA ; AL 7C + 06 (as C>9)
; AL 82

43 8086 Architecture 10/14/2021 44 8086 Architecture 10/14/2021

11
10/14/2021

Logical Instructions Logical Instructions…


 AND : Logical AND  OR : Logical OR

 bit by bit ANDs the source operand that may be an  bit by bit ORs the source operand that may be an immediate

immediate data, register or a memory location to the register or a memory location to the destination operand that
destination operand that may a register or a memory may a register or a memory location. The result is stored in
location the destination operand
 the result is stored in the destination operand  OR AX, 0008H

 AND AX, 0008H  OR AX, BX

 AND AX, BX

45 8086 Architecture 10/14/2021 46 8086 Architecture 10/14/2021

Logical Instructions… Logical Instructions…


 NOT : Logical Invert  XOR : Logical Exclusive OR

 complements the contents of an operand register or a  bit by bit XORs the source operand that may be an
memory location, bit by bit immediate register or a memory location to the destination
 NOT AX operand that may a register or a memory location

 NOT [5000H]  the result is stored in the destination operand

 XOR AX, 0098H

 XOR AX, BX

47 8086 Architecture 10/14/2021 48 8086 Architecture 10/14/2021

12
10/14/2021

Logical Instructions… Logical Instructions…


 TEST : Logical Compare Instruction  SAL/SHL : SAL / SHL destination, count

 performs a bit by bit logical AND operation on the two  SAL and SHL are two mnemonics for the same instruction

operands  Shifts each bit in the specified destination to the left and 0 is

 the result of this ANDing operation is not available for further stored at LSB position. The MSB is shifted into the carry flag.
use, but flags are affected  the destination can be a byte or a word

 TEST AX, BX  it can be in a register or in a memory location

 TEST [0500], 06H  the number of shifts is indicated by count

 SAL CX, 1

 SAL AX, CL

49 8086 Architecture 10/14/2021 50 8086 Architecture 10/14/2021

Logical Instructions… Logical Instructions…


 SHR : SHR destination, count  SAR : SAR destination, count

 shifts each bit in the specified destination to the right and 0  shifts each bit in the specified destination some number of

is stored at MSB position bit positions to the right


 the LSB is shifted into the carry flag  as a bit is shifted out of the MSB position, a copy of the old

 the destination can be a byte or a word which can be in a MSB is put in the MSB position
register or in a memory location  the LSB will be shifted into CF

 the number of shifts is indicated by count  SAR BL, 1

 SHR CX, 1  MOV CL, 04H

 MOV CL, 05H  SAR DX, CL

 SHR AX, CL

51 8086 Architecture 10/14/2021 52 8086 Architecture 10/14/2021

13
10/14/2021

Logical Instructions… Logical Instructions…


 ROL Instruction : ROL destination, count  ROR Instruction : ROR destination, count

 rotates all bits in a specified byte or word to the left some  rotates all bits in a specified byte or word to the right some

number of bit positions number of bit positions


 MSB is placed as a new LSB and a new CF  LSB is placed as a new MSB and a new CF

 ROL CX, 1  ROR CX, 1

 MOV CL, 03H  MOV CL, 03H

 ROL BL, CL  ROR BL, CL

53 8086 Architecture 10/14/2021 54 8086 Architecture 10/14/2021

Logical Instructions… Logical Instructions…


 RCL Instruction : RCL destination, count  RCR Instruction : RCR destination, count

 rotates all bits in a specified byte or word some number of  rotates all bits in a specified byte or word some number of

bit positions to the left along with the carry flag bit positions to the right along with the carry flag
 MSB is placed as a new carry and previous carry is place as  LSB is placed as a new carry and previous carry is place as

new LSB new MSB


 RCL CX, 1  RCR CX, 1

 MOV CL, 04H  MOV CL, 04H

 RCL AL, CL  RCR AL, CL

55 8086 Architecture 10/14/2021 56 8086 Architecture 10/14/2021

14
10/14/2021

Logical Instructions… Logical Instructions…


 ROR Instruction : ROR destination, count  RCL Instruction : RCL destination, count

 rotates all bits in a specified byte or word to the right some  rotates all bits in a specified byte or word some number of

number of bit positions bit positions to the left along with the carry flag
 LSB is placed as a new MSB and a new CF  MSB is placed as a new carry and previous carry is place as

 ROR CX, 1 new LSB

 MOV CL, 03H  RCL CX, 1

 ROR BL, CL  MOV CL, 04H

 RCL AL, CL

57 8086 Architecture 10/14/2021 58 8086 Architecture 10/14/2021

Logical Instructions… Branch Instructions


 RCR Instruction : RCR destination, count  Branch Instructions transfer the flow of execution of the

 rotates all bits in a specified byte or word some number of program to a new address specified in the instruction directly
bit positions to the right along with the carry flag or indirectly

 LSB is placed as a new carry and previous carry is place as  When this type of instruction is executed, the CS and IP

new MSB registers get loaded with new values of CS and IP

 RCR CX, 1 corresponding to the location to be transferred

 MOV CL, 04H  The Branch Instructions are classified into two types:

 RCR AL, CL  Unconditional Branch Instructions

 Conditional Branch Instructions

59 8086 Architecture 10/14/2021 60 8086 Architecture 10/14/2021

15
10/14/2021

Unconditional Branch Instructions Unconditional Branch Instructions…


 In Unconditional control transfer instructions, the execution  CALL : Unconditional Call

control is transferred to the specified location independent of  used to call a Subroutine (Procedure) from a main program
any status or condition  address of procedure may be specified directly or indirectly
 The CS and IP are unconditionally modified to the new CS and  there are two types of procedure depending upon whether it
IP is available in the same segment or in another segment
 Near CALL i.e., ±32K displacement

 Far CALL i.e., anywhere outside the segment

 On execution this instruction stores the incremented IP & CS

onto the stack and loads the CS & IP registers with segment
and offset addresses of the procedure to be called

61 8086 Architecture 10/14/2021 62 8086 Architecture 10/14/2021

Unconditional Branch Instructions… Unconditional Branch Instructions…


 RET: Return from the Procedure  INT N: Interrupt Type N

 at the end of the procedure, the RET instruction must be  in the interrupt structure of 8086, 256 interrupts are defined

executed corresponding to the types from 00H to FFH


 when it is executed, the previously stored content of IP and  when INT N instruction is executed, the type byte N is

CS along with Flags are retrieved into the CS, IP and Flag multiplied by 4 and the contents of IP and CS of the interrupt
registers from the stack and execution of the main program service routine will be taken from memory block in 0000
continues further segment

63 8086 Architecture 10/14/2021 64 8086 Architecture 10/14/2021

16
10/14/2021

Unconditional Branch Instructions… Unconditional Branch Instructions…


 INTO: Interrupt on Overflow  LOOP : LOOP Unconditionally

 is executed when the overflow flag OF is set. This is  executes the part of the program from the Label or address
equivalent to a type 4 Interrupt instruction specified in the instruction up to the LOOP instruction CX
 JMP: Unconditional Jump number of times. At each iteration, CX is decremented
 unconditionally transfers the control of execution to the automatically and JUMP IF NOT ZERO structure
specified address using an 8-bit or 16-bit displacement. No MOV CX, 0004H
Flags are affected by this instruction
MOV BX, 7526H
 IRET: Return from ISR
Label 1 MOV AX, CODE
 when it is executed, the values of IP, CS and Flags are
OR BX, AX
retrieved from the stack to continue the execution of the
LOOP Label 1
main program

65 8086 Architecture 10/14/2021 66 8086 Architecture 10/14/2021

Conditional Branch Instructions Conditional Branch Instructions…


 When this instruction is executed, execution control is  JNS Label

transferred to the address specified relatively in the instruction,  transfer execution control to address ‘Label’, if SF=0.

provided the condition implicit in the opcode is satisfied.  JO Label


Otherwise execution continues sequentially  transfer execution control to address ‘Label’, if OF=1.

 JZ/JE Label  JNO Label

 transfer execution control to address ‘Label’, if ZF=1.  transfer execution control to address ‘Label’, if OF=0.

 JNZ/JNE Label  JNP Label

 transfer execution control to address ‘Label’, if ZF=0  transfer execution control to address ‘Label’, if PF=0.

 JS Label  JP Label

 transfer execution control to address ‘Label’, if PF=1.


 transfer execution control to address ‘Label’, if SF=1.

67 8086 Architecture 10/14/2021 68 8086 Architecture 10/14/2021

17
10/14/2021

Conditional Branch Instructions… Conditional LOOP Instructions


 JB Label  LOOPZ/LOOPE Label

 transfer execution control to address ‘Label’, if CF=1.  Loop through a sequence of instructions from label while

 JNB Label ZF=1 and CX=0

 transfer execution control to address ‘Label’, if CF=0.  LOOPNZ / LOOPENE Label

 JCXZ Label  Loop through a sequence of instructions from label while

ZF=1 and CX=0


 transfer execution control to address ‘Label’, if CX=0

69 8086 Architecture 10/14/2021 70 8086 Architecture 10/14/2021

String Manipulation Instructions String Manipulation Instructions…


 A series of data byte or word available in memory at  The length of the string is usually stored as count in the CX

consecutive locations is referred as Byte String or Word String register

 A String of characters may be located in consecutive memory  The incrementing or decrementing of the pointer, in string

locations, where each character may be represented by its instructions, depends upon the Direction Flag (DF) Status
ASCII equivalent  If it is a Byte string operation, the index registers are updated

 The 8086 supports a set of more powerful instructions for by one


string manipulations  On the other hand, if it is a word string operation, the index

 Two parameters are required when referring to a string: registers are updated by two
 Starting and End Address of the String

 Length of the String

71 8086 Architecture 10/14/2021 72 8086 Architecture 10/14/2021

18
10/14/2021

String Manipulation Instructions… String Manipulation Instructions…


 REP : Repeat Instruction Prefix  MOVSB / MOVSW :Move String Byte or String Word

 used as a prefix to other instructions, the instruction to  Suppose a string of bytes stored in a set of consecutive

which the REP prefix is provided, is executed repeatedly until memory locations is to be moved to another set of
the CX register becomes zero (at each iteration CX is destination locations
automatically decremented by one)  The starting byte of source string is located in the memory

 REPE / REPZ - repeat operation while equal / zero location whose address may be computed using SI (Source
 REPNE / REPNZ - repeat operation while not equal / not Index) and DS (Data Segment) contents
zero  The starting address of the destination locations where this

 These are used for CMPS, SCAS instructions only, as string has to be relocated is given by DI (Destination Index)

instruction prefixes and ES (Extra Segment) contents

73 8086 Architecture 10/14/2021 74 8086 Architecture 10/14/2021

String Manipulation Instructions… String Manipulation Instructions…


 CMPS : Compare String Byte or String Word  SCAN : Scan String Byte or String Word

 can be used to compare two strings of byte or words  scans a string of bytes or words for an operand byte or word

 The length of the string must be stored in the register CX specified in the register AL or AX

 if both the byte or word strings are equal, zero Flag is set  the String is pointed to by ES:DI register pair

 the REP instruction prefix is used to repeat the operation till  the length of the string s stored in CX

CX (counter) becomes zero or the condition specified by the  the DF controls the mode for scanning of the string

REP prefix is false  whenever a match to the specified operand, is found in the

string, execution stops and the zero Flag is set


 if no match is found, the zero flag is reset

75 8086 Architecture 10/14/2021 76 8086 Architecture 10/14/2021

19
10/14/2021

String Manipulation Instructions… String Manipulation Instructions…


 LODS : Load String Byte or String Word  STOS : Store String Byte or String Word

 loads the AL/AX register by the content of a string pointed to  The STOS instruction Stores the AL/AX register contents to a

by DS : SI register pair location in the string pointer by ES : DI register pair


 the DI is modified accordingly, no Flags are affected by this
 the SI is modified automatically depending upon DF
instruction
 if it is a byte transfer (LODSB), the SI is modified by one and
 the direction Flag controls the String instruction execution
if it is a word transfer (LODSW), the SI is modified by two
 the source index SI and Destination Index DI are modified
 no other Flags are affected by this instruction
after each iteration automatically
 if DF=1, then the execution follows auto-decrement mode
where SI and DI are decremented automatically after each
iteration

77 8086 Architecture 10/14/2021 78 8086 Architecture 10/14/2021

String Manipulation Instructions… Flag Manipulation & Processor Control Instructions

 if DF=0, then the execution follows auto-increment mode  These instructions control the functioning of the available

where SI and DI are incremented automatically after each hardware inside the processor chip
iteration  These instructions are categorized into two types:

 Flag Manipulation instructions

 Machine Control instructions

79 8086 Architecture 10/14/2021 80 8086 Architecture 10/14/2021

20
10/14/2021

Flag Manipulation Instructions Machine Control instructions


 The Flag manipulation instructions directly modify some of the  The Machine control instructions control the bus usage and

Flags of 8086 execution


 CLC – Clear Carry Flag  WAIT – Wait for Test input pin to go low

 CMC – Complement Carry Flag  HLT – Halt the process

 STC – Set Carry Flag  NOP – No operation

 CLD – Clear Direction Flag  ESC – Escape to external device like NDP

 STD – Set Direction Flag  LOCK – Bus lock instruction prefix

 CLI – Clear Interrupt Flag

 STI – Set Interrupt Flag

81 8086 Architecture 10/14/2021 82 8086 Architecture 10/14/2021

END

83 8086 Architecture 10/14/2021

21

You might also like