You are on page 1of 4

Page |1

Chittagong University of Engineering &Technology

Department of Mechatronics & Industrial Engineering.

Course No.: MIE 312

Course Title: Micro-controller and Interfacing for Mechatronic systems Sessional

EXPERIMENT NO.: 3

NAME OF THE EXPERIMENT:

Multiplication and Division of two 16-bit number using EdSim51

Remarks Name: Shakline Habib

Student No: 1709020

Date of Performance: 05.09.2021

Date of Submission: 12.09.2021


Page |2

Experiment No: 03
Experiment Name: Multiplication and Division of two 16-bit number using EdSim51.
Objectives:
1. To learn about MOV, MUL and DIV instructions.
2. To learn about arithmetic operations
3. To learn about the function of Accumulator.
Problem 1:
Multiply 16-bit number at R0-R1 (Lower byte at R0) to another 16-bit number at R2-R3
(Lower byte at R2) and place the result in the Data Memory at 30H,31H,32H and 33H
location (Lower byte at 33H).
Solution:
CODE:
MOV R0, #20H
MOV R1, #21H
MOV R2, #22H
MOV R3, #23H
MOV A, R0
MOV B, R2
MUL AB
MOV 33H, A
MOV R4, B
MOV A, R0
MOV B, R3
MUL AB
ADD A, R4
MOV R5, A
MOV A, B
ADDC A, #00H
MOV R6, A
MOV A, R1
MOV B, R2
Page |3

MUL AB
ADD A, R5
MOV 32H, A
MOV A, B
ADDC A, R6
MOV 00H, C
MOV R7, A
MOV A, R3
MOV B, R1
MUL AB
ADD A, R7
MOV 31H, A
MOV A,B
ADDC A, #00H
MOV 30H, A
END
Output:
Page |4

Problem 2:
Divide 8-bit number at R0 from another 8-bit number at R1 and place the result at A & B .
Solution:

You might also like