0% found this document useful (0 votes)
14 views

Lec - 5 Micro Must

The document discusses the instruction set of the 8086 microprocessor. It covers different types of instructions like data transfer, arithmetic, logical, branching, and control instructions. For logical instructions, it provides details about AND, OR, XOR, rotate, compare, and complement operations. It also gives examples of logical and bit manipulation instructions. The document outlines branching operations like jumps and call/return. Finally, it mentions machine control instructions like HLT and NOP.

Uploaded by

ajf3215
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lec - 5 Micro Must

The document discusses the instruction set of the 8086 microprocessor. It covers different types of instructions like data transfer, arithmetic, logical, branching, and control instructions. For logical instructions, it provides details about AND, OR, XOR, rotate, compare, and complement operations. It also gives examples of logical and bit manipulation instructions. The document outlines branching operations like jumps and call/return. Finally, it mentions machine control instructions like HLT and NOP.

Uploaded by

ajf3215
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

MICROPROCESSORS

8086

MICROPROCESSORS
Lec.5
Dr. Abdallah Ramadan Fawzy
E-Mail: Abdallah.gad@must.edu.eg

The figures and text included in slides are borrowed from various books, websites, and
other sources for academic purposes only. The author do not claim any originality.
MICROPROCESSORS
8086

INSTRUCTION SET OF 8085


Classification of Instruction Set

❖Data Transfer Instruction

❖Arithmetic Instructions

❖Logical Instructions

❖Branching Instructions

❖Control Instructions
Logical Instructions

These instructions perform logical operations on data stored in


registers, memory and status flags.

The logical operations are:


❑ AND
❑ OR
❑ XOR
❑ Rotate
❑ Compare
❑ Complement
AND, OR, XOR

❑ Any 8-bit data, or the contents of register, or memory location can


logically have

❑ AND operation

❑ OR operation

❑ XOR operation

❑ with the contents of accumulator.

❑ The result is stored in accumulator.


Rotate

Each bit in the accumulator can be shifted either


left or right to the next position.
Compare

❑ Any 8-bit data, or the contents of register, or memory location can be


compares for:

❑ Equality

❑ Greater Than

❑ Less Than

❑ with the contents of accumulator.

❑ The result is reflected in status flags.


Complement

The contents of accumulator can be complemented.

Each 0 is replaced by 1 and each 1 is replaced by 0.


Logical Instructions

Opcode Operand Description


CMP R Compare register or memory with accumulator
M

 The contents of the operand (register or memory) are


compared with the contents of the accumulator.

 Both contents are preserved .

 The result of the comparison is shown by setting the


flags of the PSW as follows:
Logical Instructions

Opcode Operand Description


CMP R Compare register or memory with accumulator
M

 if (A) < (reg/mem): carry flag is set

 if (A) = (reg/mem): zero flag is set

 if (A) > (reg/mem): carry and zero flags are reset.

 Example: CMP B or CMP M


Logical Instructions

Opcode Operand Description


CPI 8-bit data Compare immediate with accumulator

 The 8-bit data is compared with the contents of


accumulator.

 The values being compared remain unchanged.

 The result of the comparison is shown by setting the


flags of the PSW as follows:
Logical Instructions

Opcode Operand Description


CPI 8-bit data Compare immediate with accumulator

 if (A) < data: carry flag is set

 if (A) = data: zero flag is set

 if (A) > data: carry and zero flags are reset

 Example: CPI 89H


Logical Instructions

Opcode Operand Description


ANA R Logical AND register or memory with
M accumulator

 The contents of the accumulator are logically ANDed with the contents of
register or memory.
 The result is placed in the accumulator.
 If the operand is a memory location, its address is specified by the contents
of H-L pair.
 S, Z, P are modified to reflect the result of the operation.
 CY is reset and AC is set.
 Example: ANA B or ANA M.
Logical Instructions

Opcode Operand Description


ANI 8-bit data Logical AND immediate with accumulator

 The contents of the accumulator are logically ANDed with the


8-bit data.
 The result is placed in the accumulator.
 S, Z, P are modified to reflect the result.
 CY is reset, AC is set.
 Example: ANI 86H.
Logical Instructions

Opcode Operand Description


XRA R Exclusive OR register or memory with
M accumulator

 The contents of the accumulator are XORed with the contents of the register or memory.

 The result is placed in the accumulator.

 If the operand is a memory location, its address is specified by the contents of H-L pair.

 S, Z, P are modified to reflect the result of the operation.

 CY and AC are reset.

 Example: XRA B or XRA M.


Logical Instructions

Opcode Operand Description


ORA R Logical OR register or memory with accumulator
M

 The contents of the accumulator are logically ORed with the contents of the register or
memory.

 The result is placed in the accumulator.

 If the operand is a memory location, its address is specified by the contents of H-L pair.

 S, Z, P are modified to reflect the result.

 CY and AC are reset.

 Example: ORA B or ORA M.


Logical Instructions

Opcode Operand Description


ORI 8-bit data Logical OR immediate with accumulator

 The contents of the accumulator are logically ORed with the 8-


bit data.
 The result is placed in the accumulator.
 S, Z, P are modified to reflect the result.
 CY and AC are reset.
 Example: ORI 86H.
Logical Instructions

Opcode Operand Description


XRA R Logical XOR register or memory with
M accumulator

 The contents of the accumulator are XORed with the contents of the
register or memory.
 The result is placed in the accumulator.
 If the operand is a memory location, its address is specified by the
contents of H-L pair.
 S, Z, P are modified to reflect the result of the operation.
 CY and AC are reset.
 Example: XRA B or XRA M.
Logical Instructions

Opcode Operand Description


XRI 8-bit data XOR immediate with accumulator

 The contents of the accumulator are XORed with the


8-bit data.
 The result is placed in the accumulator.
 S, Z, P are modified to reflect the result.
 CY and AC are reset.
 Example: XRI 86H.
Logical Instructions

Opcode Operand Description


RLC None Rotate accumulator left

 Each binary bit of the accumulator is rotated left by one


position.
 Bit D7 is placed in the position of D0 as well as in the Carry
flag.
 CY is modified according to bit D7.
 S, Z, P, AC are not affected.
 Example: RLC.
Logical Instructions

Opcode Operand Description


RRC None Rotate accumulator right

 Each binary bit of the accumulator is rotated right by one


position.
 Bit D0 is placed in the position of D7 as well as in the Carry
flag.
 CY is modified according to bit D0.
 S, Z, P, AC are not affected.
 Example: RRC.
Logical Instructions

Opcode Operand Description


RAL None Rotate accumulator left through carry

 Each binary bit of the accumulator is rotated left by one


position through the Carry flag.
 Bit D7 is placed in the Carry flag, and the Carry flag is placed in
the least significant position D0.
 CY is modified according to bit D7.
 S, Z, P, AC are not affected.
 Example: RAL.
Logical Instructions

Opcode Operand Description


RAR None Rotate accumulator right through carry

 Each binary bit of the accumulator is rotated right by one


position through the Carry flag.
 Bit D0 is placed in the Carry flag, and the Carry flag is placed in
the most significant position D7.
 CY is modified according to bit D0.
 S, Z, P, AC are not affected.
 Example: RAR.
Logical Instructions

Opcode Operand Description


CMA None Complement accumulator

 The contents of the accumulator are complemented.


 No flags are affected.
 Example: CMA.
Logical Instructions

Opcode Operand Description


CMC None Complement carry

 The Carry flag is complemented.


 No other flags are affected.
 Example: CMC.
Logical Instructions

Opcode Operand Description


STC None Set carry

 The Carry flag is set to 1.


 No other flags are affected.
 Example: STC.
Example Logical & Bit Manipulation Operations /
Instructions

1. Logically AND Register H ANA H


with Accumulator
2. Logically OR Register L with ORA L
Accumulator
3. Logically XOR Register B XRA B
with Accumulator
4. Compare contents of CMP C
Register C with Accumulator
5. Complement Accumulator CMA
6. Rotate Accumulator Left RAL
4. Branching Operations

These operations are used to control the flow of program execution


1.Jumps

• Conditional jumps
• Unconditional jumps
2.Call & Return
• Conditional Call & Return
• Unconditional Call & Return
5. Machine Control Instructions
These instructions affect the operation of the
processor. For e.g.
HLT Stop program execution
NOP Do not perform any operation

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy