Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Heaven’s Light is Our Guide

Rajshahi University of Engineering &


Technology
(RUET), Rajshahi

Department of Electrical and Electronic Engineering (EEE)

Experiment no.: 03
Name of the experiment: Experimental study of 8051 arithmetic assembly
language instructions using EdSim51 emulator software.

Course title: Embedded System Design Submitted by-


Sessional Name: MD. NAEEM HOSSAIN
Roll no.: 141004
Course no.: EEE-4210 Section: A
Class: 4th Year Even Semester
Date of experiment: 06-03-19
Session: 2014-15
Date of submission: 24-03-19

Year: 2019

Experiment No.: 03
Name of the experiment: Experimental study of 8051 arithmetic assembly language
instructions using EdSim51 emulator software

Objectives: The objectives of this experiment are-


1. To learn the basic instructions of EdSim51 emulator software.
2. To perform simple programs in EdSim51 emulator software.

Introduction: EdSim51 was developed by James Rogers and it is a simulator that is widely used
for multiple purposes. A screenshot of EdSim51 is given below.

Fig. 3.1: EdSim51 emulator software.


In figure 3.1,
 The top left box gives the user access to all the 8051’s registers, data memory and code
memory.
 There is a textbox in the center where the user either loads an assembly program or writes
the code directly.
 On the right hand side, there is a list of the 32 port pins and with what each one is
connected to. The current value of the port pin is displayed here.
 Finally, the bottom panel shows all the peripherals that are connected to the 8051.
For the beginner’s, it is imperative to ignore the peripherals. It will help to get accustomed to the
arithmetic and branch instructions that make up the 8051 instructions set.
Some of the peripherals share the same port pins. For example, the 7-segment display’s data lines
and the DAC are connected to port 1. This means that, if the programmer wishes to use the
display and the DAC together, he/she must learn how to disable one to access the other.
Otherwise, the peripherals can be moved, i.e., connected to other port pins.
Required apparatus: EdSim51 software

Program 1: Write a program to add the values of location 55H and 57H and store the values in
location 58H and 59H.

Program:
MOV 55H, #0FFH
MOV 57H, #0FEH
MOV A, 55H
ADD A, 57H
MOV 58H, A
JC NEXT
NEXT: MOV 59H, #1H
Output:

Program 2: Write a program to subtract the values of location 40H and 41H and store the values
in location 42H.
Program:
MOV 40H,#32H
MOV 41H,#21H
MOV A,40H
SUBB A,41H
MOV 42H,A

Output:
Program 3: Write a program to multiply the values of location 55H and 57H and store the
values in location 58H and 59H.
Program:
MOV 55H, #0FFH
MOV 57H, #0FEH
MOV A, 55H
MOV B, 57H
MUL AB
MOV 58H,A
MOV 59H,B
Output:
Program 4: Write a program to divide the values of location 55H and 57H and store the values
in location 58H and 59H.
Program:
MOV 55H, #105
MOV 57H, #25
MOV A, 55H
MOV B, 57H
div AB
MOV 58H,A
MOV 59H,B
Output:

Discussion: In this experiment the basic instruction set of 8051 was learnt. After that, a few
programs were performed in EdSim51 emulator software and the outputs were also observed.

You might also like