Академический Документы
Профессиональный Документы
Культура Документы
MICROPROCESSORS AND
MICROCONTROLLERS LABORATORY
MANUAL
1
Syllabus:
2
Experiment No.1(a):
16 bit Addition
Algorithm:
Step-1: Load the first data in AX register.
Step-2: Load the second data in BX register.
Step-3: Clear CL register.
Step-4: ADD two data and get the sum in AX register.
Step-5: Store the sum in memory.
Step-6: Check for carry, if carry flag is set then go to next step, otherwise go to step-8.
Step-7: Increment CL register.
Step-8: Store the carry in memory.
Step-9: Stop.
Program:
Result :
Thus an assembly language program to add two 16-bit data is executed and output was
verified.
3
Flow Chart:
Start
Clear CL register
YES
IF
CF=
1 Increment CL register
NO
Stop
Output:
Input Data
Data 1: 1009
Data 2: 1001
8401
Carry:8402
4
Experiment No.1(b):
Aim: To write an assembly language program to subtract two numbers of 16-bit data.
16 bit Subtraction
Algorithm:
Step-1: Load the first data in AX register.
Step-2: Subtract the second data from first data where the second data is accessed through its
address, store the result in AX registers
Step-3: Move the result AX register to destination address
Step-4: Stop.
5
Experiment No.1(c):
Aim: To write an assembly language program to multiply two numbers of 16-bit data.
16 bit Multiplication
Algorithm:
Step-1: Load the address of the first data in AX register.
Step-2: Multiply the second data with first data, where the second data is accessed through its
address and store the result in AX register.
Step-3: Move the first 16 bit result from AX register to the destination address
Step-4: Move the second 16 bit result from BX register to the destination address
Step-5: Stop
6
Experiment No.1(d):
Aim: To write an assembly language program to divide 32 bit data by 16-bit data.
16 bit Division
Algorithm:
Step-1: Load the address of the first data in AX register
Step-2: Divide the first data by second data, where the second data is accessed through its
address and store the result in AX register.
Step-3: Move the quotient to the destination address AX register.
Step-4: Move the remainder to the destination address from BX register.
Step-5: Stop.
7
Experiment No. 2(a):
8
Experiment No. 2(b):
Sort an array in Descending order using 8086 microprocessor
Aim:
To write an assembly language program to Sort an array in Descending order
9
Experiment No. 3(a):
String Move
Aim:
To write an assembly language program to start a string moving an array of
memory location
String Move
Algorithm:
Step-1: Move the length of the string source index address 2000H to SI.
Step-2: Move the length of the string destination index address 2100H to DI.
Step-3: Store the string value in CX register.
Step-4: Store the byte string in a destination memory address.
Step-5: If count = 0 then string go to step 5
Step-6: Move the all data 2000H and 2100H
Step-7: Stop.
10
Experiment No. 3(b):
String Manipulation
Aim:
To write an assembly language program to store a string moving in an array of
memory location
String Manipulation
Algorithm:
Step-1: Store the hexadecimal count in CX register
Step-2: Store destination index offset S-array in a memory address
Step-3: Store the string value in accumulator
Step-4: Clear direction flag.
Step-5: Store the byte string in a destination memory address.
Step-6: If count =0 then go next step else go to step 5.
Step-7: Stop.
11
Experiment No. 4:
Apparatus Required: 8086 P kit, 8253 programmable interval timer, CRO, 12 V power
supply.
Algorithm:
Step-1: Start the program
Step-2: Load the data into AL register
Step-3: Read the output of the AL to AX register
Step-4: Repeat the above steps 1 and 3
Step-5: Stop.
12
Experiment No.5(a):
13
Experiment No.5(b):
14
Experiment No.5(C):
15
Experiment No.5(d):
16
Experiment No.6:
17
Experiment No.7:
18
Experiment No.8:
19