Professional Documents
Culture Documents
Experiment 3
Experiment 3
Experiment 3
Submitted by Submitted to
3.2 Objectives
1. To learn and use Arithmetic operation like Division, Multiplication etc.
2. To Observe the outputs on MDA-8086 .
3.3 Theory
These instructions are used to perform arithmetic operations like addition, subtraction,
multiplication, division, etc.
Following is the list of instructions under this group −
Instructions to perform addition
ADD: Used to add the provided byte to byte/word to word.
ADC: Used to add with carry.
INC: Used to increment the provided byte/word by 1.
Instructions to perform subtraction
SUB: Used to subtract the byte from byte/word from word.
SBB: Used to perform subtraction with borrow.
DEC: Used to decrement the provided byte/word by 1.
NEG: replaces the value of a register or memory operand with its two's
complement.
CMP: Used to compare 2 provided byte/word.
Instruction to perform multiplication
MUL: Used to multiply unsigned byte by byte/word by word.
Byte with Byte multiplication: This instruction is Used to multiply unsigned byte by
byte/word by word. In this operation, one operand is stored in AL register and the other
one is source and their result is stored in AX register. 8-bit register. Example:
𝑀𝑈𝐿 𝐵𝐻 𝑀𝑈𝐿 𝐶𝑋
Word with Word multiplication: In this operation, one operand is stored in AX register
and the source must be a 16-bit register or a memory address. The result is stored in DX
register. 8 or 16- bit register. This instruction is Used to multiply signed byte by byte/word
by word. Example:
𝐼𝑀𝑈𝐿 𝐶𝑋
SUB/SBB:
_CODE SEGMENT
ASSUME CS:_CODE
MOV AL,11101100B
MOV BL,11110011B
SUB AL,BL
SBB AL,00000110B
HLT
_CODE ENDS
MUL:
CODE SEGMENT
ASSUME CS:_CODE
MOV AX,123H
MOV BX,1C8H
MUL BX
HLT
_CODE ENDS
IMUL:
_CODE SEGMENT
ASSUME CS:_CODE
MOV AX,0000000000010111B
MOV BX,1111111111100010B
IMUL BX
HLT
_CODE ENDS
DIV:
_CODE SEGMENT
ASSUME CS:_CODE
MOV AX,500d
MOV BX,250d
DIV AX,BX
HLT
_CODE END
IDIV:
_CODE SEGMENT
ASSUME CS:_CODE
MOV AX,500d
MOV BX,250d
IDIV AX,BX
HLT
_CODE END
CMP:
_CODE SEGMENT
ASSUME CS:_CODE
MOV AX,24D
MOV BX,35D
CMP AX,BX
HLT
_CODE ENDS