You are on page 1of 19

BIT MANIPULATION

INSTRUCTIONS

Logical Shift Rotate


Logical

AND OR XOR NOT


Logical
EXAMPLE
Shift
SHL SHR SAL SAR
Example:1
org 0x100

MOV AL,10011001b;
MOV CL,01H;
SHR AL,CL;
Execution in EMU8086
Example:1
org 0x100

MOV AL,10011001b;
MOV CL,01H;
SAR AL,CL;
Execution in EMU8086
Rotate
ROR ROL RCL RCR
Example:1
org 0x100
MOV AL,10011111b;
MOV CL,01H;
ROL AL,CL;
Execution in EMU8086
Example:2
org 0x100
MOV AL,10011111b;
MOV CL,01H;
RCL AL,CL;
Execution in EMU8086
PUSH AND POP INSTRUCTIONS
• Push instruction: This instruction add the content in Stack.
Instruction formula:
Push + register;
• POP instruction: This instruction extracts the content from Stack.
Instruction formula:
POP + register;
Example: Add the content of registers AX and BX in
to stack, then extract the contents into register AX
by using push and pop instructions.
Solution:
MOV AX,1234H;
MOV BX,2345H;
PUSH AX;
PUSH BX;
POP AX;

You might also like