You are on page 1of 2

ADDITION OF ARRAY OF NUMBERS

AIM:
To perform the addition of array of numbers by using 8051 microcontroller.
APPARATUS REQUIRED:
 8051 microcontroller kit
 Opcode sheet
ALGORITHM:
1. Start the program
2. Get the Count( Ro) & Input data in memory.
3. Add the data and move the result to R1 register..
4. If Carry is present , increment R1Register, otherwise go to next step.
5. Increment DPTR register for next data.
6. If Zero flag is not set go to step 3, otherwise go to next step.
7. Store the result in Memory
8. Stop the program
FLOW CHART:
PROGRAM:
MEMORY
LABEL OPCODES
ADDRESS MNEMONICS
8500 90 86 00 MOV DPTR, #8600H
8503 78 05 MOV R0, #05
8505 79 00 MOV R1, #00
8507 L1: E0 MOVX A,@DPTR
8508 29 ADD A, R1
8509 F9 MOV R1, A
850A A3 INC DPTR
850B D8 FA DJNZ R0, 8507
850D E9 MOV A, R1
850E 90 87 00 MOV DPTR, #8700H
8511 F0 MOVX @DPTR, A
8512 L2: 80 FE SJMP 8512

INPUT:

MEMORY
DATA 1 DATA 2 DATA 3
ADDRESS
8600 05 0A
8601 04 0A
8602 03 0A
8603 02
8604 01
8605
8606
8607

OUTPUT:
MEMORY
DATA 1 DATA 2 DATA 3
ADDRESS
8700 0F 1E

RESULT:
Thus the assembly language program was written to perform the addition of array of numbers
and executed using 8051 microcontroller.

You might also like