Vous êtes sur la page 1sur 4

Flow chart of the program (Exercise)

Start

Open HyperTerminal on Dekstop

Open file ‘8051.ht’ in File


Menu

Turn-on the 8051 Development


System

Reset the 8051

Menu will be shown in the


HyperTerminal

Type program code into Notepad

Save as in directory D:/uplab


with the filename is
TEST.ASM

Open Command Prompt

Change to directory D by typing D:

Type cd uplab and directory


D:>UPLAB will be
displayed

A
A

Assemble the program

Listing file and hex


file will be generated

Reset the 8051

Monitor program
displayed

Load the file in the


HyperTerminal

Open the test.hex file

The test.hex file content displayed

Press any key on the next prompt

Type ‘E’ to execute the program

Type ‘2000’ as the program address

Determine the contents of


registers after execute the
program

End
Flow chart of the program (Exercise)

Start

Declare type and starting address

Move a number into accumulator

Store the number in register R0

Store the number in register R1

Add the number in accumulator


with value of R1

Store the number in register R2

Add the number in accumulator


with value of R2

Store the number in register R3

Add the number in accumulator


with value of R0, R1, R2

Store the number in register R4

End
Program code (Exercise)

CPU ”8051.TBL”
INCL “8051.INC”
ORG 2000H
MOV SP, 030H
MOV A, #0AH
MOV R0, A
MOV R1, #26H
ADD A,R1
MOV R2,A
ADD A,R2
MOV R3,A
ADD A,R2
ADD A,R1
ADD A,R0
MOV R4,A
END

Vous aimerez peut-être aussi