Lab 9 Objective: To Study and Understand The Assembly Language Instructions For Basic Logic Operations
Lab 9 Objective: To Study and Understand The Assembly Language Instructions For Basic Logic Operations
Lab 9 Objective: To Study and Understand The Assembly Language Instructions For Basic Logic Operations
Objective
To study and understand the Assembly Language instructions for basic logic
operations.
AND Instruction
The AND Operation is used to set bits to 0. AND a bit with 1, it stays the same.
AND a bit with 0, it becomes 0.
A B A.B
0 0 0
1 0 0
0 1 0
1 1 1
Two Inputs AND Gate
Program
Input
84
Output
OR Instruction
The OR Operation is used to set bits to 1. OR a bit with 0, it stays the same. OR a
bit with 1, it becomes 1.
A B A+B
0 0 0
1 0 1
0 1 1
1 1 1
Two Inputs OR Gate
85
Program
Input
Output
86
NOT Instruction
NOT instruction is an inverter.
A A̅
0 1
1 0
NOT Gate
Program
Input
Output
87
XOR Instruction
The XOR Operation is used to set bits to the opposite value. XOR a bit with 0, it
stays the same. XOR a bit with 1, it becomes the opposite value.
A B A⊕B
0 0 0
1 0 1
0 1 1
1 1 0
Two Input XOR Gate
Program
Input
Output
88
NEG Instruction
NEG instruction is act as 2’s complement.
Program
Input
Output
89
TEST Instruction
TEST instruction is used to check which flag is ON and OFF i.e., CF, PF, ZF.
Program
Input
Output
90
Conclusion
In this lab, we have learnt about the Assembly Language instructions for basic
logic operations. We have also implemented these instructions i.e., AND, OR,
NOT, XOR, NEG and TEST instructions in program using Emu8086.
91