Instruction Set and Assembler Directives
Instruction Set and Assembler Directives
AX,[BX] INC SP
ARITHMETIC INSTRUCTIONS
• SUBTRACT instruction
Examples
SUB AX, SP SUB DH,6F
SBB AX,BX DEC BH
ARITHMETIC INSTRUCTIONS
• MULTIPLICATION instructions
MUL CL
MUL CX IMUL CL
• DIVISION instructions DIV CL
IDIV SI
LOGICAL INSTRUCTION
• AND instruction
Example
AND AL,BL
• OR instruction
Example
OR SI,DX
• XOR instruction
XOR CH,OE
• NOT instruction
NOT CH
Shift and Rotate Instruction
• SHL instruction
SHL AX,1
• SHR instruction
SHR AX,CL
• ROL instruction
ROL AX,1
• ROR instruction
ROR AX,CL
Jump Instruction
• Jump instruction are used to change the
execution path of instruction in the
program.
i) Unconditional Jump Short Jump
Near Jump Far Jump
ii)Conditional Jump
String and String Handling
Instructions
• Move Operation: Move is a process of
moving a string of data from one Memory
Location to another.
Eg. MOVSB: This instruction moves a byte of
data from one memory location to another.
MOVSW: This instruction moves a word of
data from Source to Destination Operand.
String and String Handling
Instructions
• Compare Operation: Compare is a process of
comparing two elements in the same or
different string.
Eg. COMPSB: This instruction compares a byte
of data from one memory location to another.
COMPSW: This instruction compares a word of
data from one memory location to another.
String and String Handling
Instructions
• SCAN: SCAN is a process of comparing
elements of Destination string with
Accumulator.
Eg. SCASB: This instruction scans a byte of
data from Destination with Accumulator
Register.
SCASW: This instruction scans a word of data
from Destination with Accumulator Register.
String and String Handling
Instructions
• Load Operation: Load is a process of loading
string elements from Memory Location with
Accumulator.
Eg. LODSB: This instruction loads a byte of
data from Memory Location with
Accumulator.
LODSW: This instruction lods a word of data
from Memory Location with Accumulator.
String and String Handling
Instructions
• Store Operations: Store is a process of moving
string of elements from Accumulator to
Memory Location.
Eg.STOSB: This instruction stores a byte of
data from Accumulator to Memory Location.
STOSW: This instruction stores a word of data
from Accumulator to Memory Location.
String and String Handling
Instructions
• AUTO INDEXING: Auto Indexing is a
process of Incrementing or Decrementing the
content of Source Index or Destination Index.
Eg.CLD: When this instruction is executed
Direction Flag is cleared to zero. Now Auto
Incrementing Source Index or Destination
Index takes place.
Thank
You