Sunteți pe pagina 1din 6

Experiment 9

EVD16I001:-

EXERCISE-3:

Aim: To perform mul plica on and division of two 8-bit,16-bit numbers, addi on
of two matrices and finding the square of a number by using 8086
microprocessors.

REQUIREMENTS:

8086 MICROPROCESSOR, Power Supply, Keyboard.

THEORY:

The following are the instruc ons that I had used in my code:

● 1.MOV
Syntax: operand1 MOV operand2
The MOV instruction copies operand2 into operand1. In this program,
it is used to copy the data at a specific memory location into a
register, and the data in a register into a specific memory location.

2.INC
Syntax: INC operand
The INC instruction increments operand, so that operand = operand
+1. In this program, it operates on the memory location. It is used to
move to the next memory location after storing an integer, in order to
store the next one.

3.ADD
Syntax: operand1 ADD operand2
The ADD instruction adds the values of operand1 and operand2, and
stores the result in the place of operand1. In this program, the
operands are the values stored in the registers.

4.MUL:
Syntax: MUL multiplier
There are two instructions for multiplying binary data. The MUL
(Multiply) instruction handles
unsigned data and the IMUL (Integer Multiply) handles signed data.
Both instructions affect the
Carry and Overflow flag.

5.DIV:
Syntax: DIV divisor
This instruction is used to divide an unsigned 8-bit or 16-bit number.
The dividend should be stored
at AX. The divisor can be in a register or a memory location. After the
division ,AL will contain the 8-
bit quotient, and AH will contain the 8-bit remainder, AX will contain
the quotient, and DX will
contain the remainder for a 16-bit division.

6.LOOP: This instruc on repeats a series of instruc ons some number of


mes. The number of mes the sequence to be repeated is loaded into CX.
CX gets decremented by 1 for every execu on of the sequence.
CX is not 0 → execu on jumps to the specified des na on by the label
CX =0 →execu on goes to the next instruc on a er loop.

7.HLT: This instruc on halts the system.


General Instruc ons:

1.GO Address of the program will execute the program that hold the
address

men oned in the command.

2.U with address of the program next to it helps the user to see the code
which has

the address in the command.

3.A with address of the instruc on next to it helps the user to edit the
instruc on

in the program.

4.SW with address next to it takes a 16-bit input and SB with address next
to it

takes a 8-bit input.


ALGORITHM:
1.Multiplication of two 8-bit numbers:

2.Division of two 16-bit numbers:


4.Square of two numbers:

CODING

1.Multiplication of two 8-bit numbers:

INSTRUCTION OPCODE

Program Address-1700

MOV SI,1300 C7C60013

MOV DI,1500 C7C60015

MOV AL,[SI] 8A04

INC SI 46

MOV BL,[SI] 8AIC

MUL BL F6E3

MOV DI,[AX] 8905

HLT

Calculations:
02
+0 3
-----------
05
-----------

2.Division of two 16-bit numbers:

INSTRUCTION OPCODE

Program Address-2200

MOV SI,1100 C7C60016

MOV AH,00 C7C60015

MOV AL,[SI] 8A04

INC SI 46

INC SI 46

MOV BL,[SI] 8A1C

DIV BL F4E3

MOV [3500],AL 88060035

MOV [3501],AH 88260135

HLT F4

Calculations:
0010
/0 0 0 2
-----------
0005
-----------

3.Addition of two matrices:

INSTRUCTION OPCODE

Program Address-2700

MOV CX,004 C7C10400

S-ar putea să vă placă și