1. ASSALAM-O-ALAIKUM EVERYONE
Presented by
Amna Mehmood (3205)
Mehak Usman (3206)
Aiza Zulfiqar (3199)
Humaira Azam (3228)
Haiqa Arshad (3190)
Presented To
Sir Bilal Sardar
Date: 25th Feb, 2022
2. Table of content
• Logical Operator
• Shift And Rotate Instruction
• Device Drivers
3. Logical Operator
A logical operator is a symbol or word
used to connect two or more expressions
such that the value of the compound
expression produced depends only on
that of the original expressions
There are Five logical operators:
• AND
• OR
• NOT
• XOR
• TEST
Sr No. Instruction Format
1 AND AND operand1,
operand2
2 OR OR operand1,
operand2
3 XOR XOR operand1,
operand2
4 TEST TEST operand1,
operand2
5 NOT NOT operand1
4. AND Instruction
• The AND instruction is used for supporting logical
expressions by performing bitwise AND operation.
• The bitwise AND operation returns 1, if the
matching bits from both the operands are 1,
• otherwise it returns 0.
For Example:
Operand1: 0101
Operand2: 0011
After AND -> Operand1: 0001
5. OR Instruction
• The OR instruction is used for supporting logical
expression by performing bitwise OR operation.
• The bitwise OR operator returns 1, if the matching
bits from either or both operands are one.
• It returns 0, if both the bits are zero.
For Example:
Operand1: 0101
Operand2: 0011
After OR -> Operand1: 0111
6. NOT Instruction
• The NOT instruction implements the bitwise NOT
operation.
• NOT operation reverses the bits in an operand.
• The operand could be either in a register or in the
memory.
For Example:
Operand1: 0101 0011
After NOT -> Operand1: 1010 1100
7. XOR Instruction
• The XOR instruction implements the bitwise XOR operation.
• The XOR operation sets the resultant bit to 1, if and only if the
bits from the operands are different.
• If the bits from the operands are same (both 0 or both 1)
• the resultant bit is cleared to 0.
For Example:
Operand1: 0101
Operand2: 0011
After XOR -> Operand1: 0110
8. TEST Instruction
• The TEST instruction works same as the AND operation, but unlike
AND instruction,
• It does not change the first operand.
• So, if we need to check whether a number in a register is even or
odd, we can also do this using the TEST instruction without
changing the original number.
For Example:
TEST AL, 01H
JZ EVEN_NUMBER
9. Shift and Rotate Instructions
• Shifting means to move bits right and left inside an operand.
• All of the Shift and Rotate instructions affect Overflow and Carry
Flags.
• The Shift and Rotate instructions include:
• SHL - Shift Left ROL – Rotate Left
• SHR - Shift Right ROR – Rotate Right
• SAL – Shift Arithmetic Left RCL - Rotate Carry Left
• SAR – Shift Arithmetic Right RCR - Rotate Carry Right
10. SHL & SHR Instruction
• The Shift Left instruction performs a left shift on the destinations
operand, filling the lowest bit with 0.
• The highest bit is moved into the Carry Flag.
The instruction format of SHL is:
• SHL destination, bits shifted.
• The Shift Right instruction performs a right shift on the
• destinations operand, filling the lowest bit with 0.
• The lowest bit is moved into the Carry Flag.
• The instruction format of SHR is:
• SHR destination, bits shifted.
11. SAL and SAR Instructions
• SAL (Shift Arithmetic Left) is identical to the
SHL instruction.
• SAR (Shift Arithmetic Right) performs a
right arithmetic
• shift on its operand.
• The instruction format is:
SAR destination, bits shifted
12. ROL & ROR Instruction
• The ROL instruction shifts each bit to the left, with the
• highest bit copied in the Carry flag and into the lowest bit.
• The instruction format of ROL is:
• ROL destination, bits shifted
• The ROR instruction shifts each bit to the right, with the
• lowest bit copied in the Carry flag and into the highest bit.
• • The instruction format of ROR is:
• ROR destination, bits shifted
13. RCR & RCL Instruction
• The RCL (Rotate and Carry Left) instruction shifts
each bit to the left, copies the Carry flag to the least
significant bit and copies
• The most significant bit into the Carry flag.
• The RCR (Rotate and Carry Right) instruction
shifts each bit to the right, copies
• The Carry flag to the most significant bit and copies
• The least significant bit into the Carry flag.
14. Device Driver
• A device driver is a computer program
• that enable one or more hardware devices to
communicate with the computer's operating system.
• Without drivers the computer could not send and
receive data correctly to hardware devices
• such as a printer.
15. Device need Driver
• Hardware devices unknown by operating
system
• have features unknown
• by the operating system all require drivers.
Example: card reader, modem, printer, scanner ,
sound card, video card, USB devices.
16. Devices may not need Drivers
• Today's operating systems have many generic drivers that
allow hardware to work at a basic level without needing
drivers or software.
• However, if that device has features unknown to the
operating system, it will not work without drivers.
For example: you could plug any keyboard into a
computer and expect it to work. However, if that keyboard
has any special keys or features, they will not work until the
drivers are installed.
17. Working of a device driver
• A device driver act as a translator between application and
hardware.
For example: a printer driver tells the printer in which
format to print after getting instruction from OS,
similarly A sound card driver is there due to which 1’s
and 0’s data of MP3 file is converted to audio signals
and you enjoy the music.
• The device driver communicates with the computer
system through the computer bus which is used to
connect the device with computer.
18. Purpose of Device Drivers
• Operate and control a device attached to a computer.
• Provide an interface between the operating system (or
application) and the device.
• To tell the operating system how to communicate with
the hardware component.
• Translate requests between the device and the
computer.
19. Types of Device Driver
• Kernel-mode Device Driver –This Kernel-mode
device driver includes some generic hardware
• Which loads wit h operating System as part the OS
• These are BIOS, motherboard, processor and some
other hardware which are part of kernel software.
20. Types of Device Driver
• User-mode Device Driver –Other than the devices
which are brought by kernel for working of the system
• The user also bring some devices for use during the
using of a system
• That devices needs device drivers to functions those
drivers falls under User mode device driver.
21. Types of Device Driver
Virtual Device Drivers-Virtual device drivers are
different than most drivers.
Unlike the majority of drivers, which allow pieces of
hardware to work with a particular operating system
virtual device drivers emulate a piece of hardware
and essentially trick the computer into thinking that
it is reading from a piece of actual hardware.
A particularly popular use for virtual device drivers.