0% found this document useful (0 votes)
127 views

Lab 3

This lab document covers arithmetic operations in microcontrollers including addition, subtraction, multiplication, and division. It provides code examples to demonstrate how to perform each operation using assembly language instructions. The objective is to learn how to do basic arithmetic at the hardware level. The equipment needed includes an 8086 trainer kit and power cables. The output section shows the results of sample code executing each operation on different operands stored in registers. Exercises are provided to practice different ways to perform each arithmetic operation using registers and memory.

Uploaded by

farheen khoso
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views

Lab 3

This lab document covers arithmetic operations in microcontrollers including addition, subtraction, multiplication, and division. It provides code examples to demonstrate how to perform each operation using assembly language instructions. The objective is to learn how to do basic arithmetic at the hardware level. The equipment needed includes an 8086 trainer kit and power cables. The output section shows the results of sample code executing each operation on different operands stored in registers. Exercises are provided to practice different ways to perform each arithmetic operation using registers and memory.

Uploaded by

farheen khoso
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Microcontroller and Microprocessor lab 3

LAB#3

Lab – 3: Arithmetic Blocks

3.1 Objective:
 To learn the basic Arithmetic Operations ( Addition, Subtraction, Multiplication and
Division)
3.2 Pre-Lab Reading:
Intel Microprocessors: Architecture, Programming and Interfacing, 8th Edition, BARRY B.
BREY, Chapter 5, Topic 5.1, 5.2
3.3 Equipment:
Instruments MDA-Win 8086 Trainer
Kit

Components Power Cables

3.4 Code:
3.4.1 Addition:
Algorithm: Operend1 = Operend1 + Operend2
Example:
MOV AL, 5
ADD AL, -3
RET
3.4.2 Subtraction:
Algorithm: Operend1 = Operend1 - Operend2
Example:
MOV AL, 5
ADD AL, 1
RET

1
21395
Microcontroller and Microprocessor lab 3

3.4.3 Multiplication:
Algorithm: AX = AL * operand or DX AX = AX * operand
Example:
MOV AL, 301
MOV BL, 6
MUL BL
RET
3.4.4 Division:
Algorithm: AL = AX / operand, AH = reminder or AX= (DX AX) / operand,
DX=reminder
Example:
MOV AL, 100
MOV BL, 3
DIV BL
RET

3.5 Output:
2.5.1: AL = 05H
AL = 02H
2.5.2: AL = 05H
AL = 04H
2.5.3: AL = 00C8H
BL = 04H
AX = 0320H (800)
2.5.4: AX = 00CBH
BL = 04H
AL= 50 (32h), AH = 3
2.7 Exercise:
2
21395
Microcontroller and Microprocessor lab 3

2.7.1 Addition:
Addition can be performed in the following way:
REG, Memory
Memory, REG
REG, REG
Memory, Immediate
REG, Immediate
3.7.2 Subtraction:
Subtraction can be performed in the following way
REG, Memory
Memory, REG
REG, REG
Memory, Immediate
REG, Immediate
3.7.3 Multiplication:
Multiplication can be performed in the following way
REG
Memory
3.7.4 Division:
Division can be performed in the following way
REG
Memory

2.8 Notes:

3
21395
Microcontroller and Microprocessor lab 3

 When two operands are required for an instruction they are separated by comma. For
example:

REG, memory

 The size must be of same For example:

AL, DL
DX, AX

 Mov instruction is used for transfer of data


Mov AX,BX

2.9 Assessment Sheet:


CMS ID: 21395
DATE: 20-04-2015

1-basic arithmetic operations


Problem Number
2-mul/div/add/sub

Working
Lab Performance
Viva

Total Score in Lab#10

Instructor's Verification

4
21395
Microcontroller and Microprocessor lab 3

5
21395

You might also like