0% found this document useful (0 votes)
23 views9 pages

Introduction to EdSim51 Simulator

The document describes an experiment using EdSim51 software to learn assembly language programming on the 8051 microcontroller. It explains the main parts of the EdSim51 interface, including the microcontroller panel displaying registers and memory, the assembly code panel for writing and debugging code, and peripherals for simulation. It then provides 10 problems and solutions demonstrating instructions for moving data between registers, memory and peripherals like reading/writing SBUF and using pointers.

Uploaded by

AnonsNobel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views9 pages

Introduction to EdSim51 Simulator

The document describes an experiment using EdSim51 software to learn assembly language programming on the 8051 microcontroller. It explains the main parts of the EdSim51 interface, including the microcontroller panel displaying registers and memory, the assembly code panel for writing and debugging code, and peripherals for simulation. It then provides 10 problems and solutions demonstrating instructions for moving data between registers, memory and peripherals like reading/writing SBUF and using pointers.

Uploaded by

AnonsNobel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Page |1

Experiment No: 01
Experiment Name: Introduction to EdSim51 and assembly language programming on
EdSim51
Objectives:
[Link] learn about the installation process of EdSim51.
[Link] familarize the User Interface (UI) of EdSim51.
3. To learn the programming and simulation in EdSim51.

EdSim51 (V-2.1.10)

Fig: 01–EdSim51
Main Parts of EdSim51:
1. The Microcontroller Panel
a. The Bitfield
b. Data and Code Memory
2. The Assembly Code Panel
a. Source Pane Unlocker
b. Load and Save
c. Copy and Paste
Page |2

d. A Few Notes on the Assembler


e. Debugging
f. Breakpoints
3. The Peripherals
a. The Logic Diagram
b. The LED Bank, DAC and the 7-segment Displays
c. The LCD Module
d. The Switch Bank and the ADC
e. The Comparator and the DAC
f. The Motor
g. The UART
h. The Keypad

The Microcontroller Panel: All the registers are assigned in this part. The value of each
register is shown here. The Code Memory and Data Memory are also assigned in this part.
Some pins are placed here.

Fig: 02- Microcontroller Panel


Page |3

The Assembly Code Panel: In this portion assembly code is written. There are some options
to run or modify the code. The assembler finds the mistake of coding and show the error for
the user.

Fig: 03-Assembly Code Panel

The Peripherals: This is the portion where simulation takes place. There are many
simulating options like: Motor, Display, LCD etc. With the help of this Peripherals we can
easily justify weather our program is okay or not.

Fig: 04-Peripherals
Page |4

Tasks:
Problem 4.1:Read SBUF and Store in R0.
Solution:

Explanation: SBUF is an SFR. So, it needs direct address mode and SBUF address is 99H.
So 99H will be stored in R0.
Problem 4.2: Write into the TCON the control bits 0100 0000(Equivalent 40H)
Solution:
Page |5

Explanation: TCON is an SFR and so it is in the direct addressable space. TCON address is
88H.
Problem 4.3: R0 is a pointer for the address where the SBUF is to be saved. What will be
instructions to save SBUF.
Solution:

Explanation: Here R0 is used as an indirect address to read and save SBUF.


Problem 4.4: R2 Stores a byte, which happens to be a pointer for address where the SBUF is
to be saved. What will be instructions to save SBUF?
Solution:

Explanation: Here first R2 should be transferred to another register, and then it can be used
as pointer. R0 can be used as an indirect address. This read SBUF and save SBUF.
Page |6

Problem 4.5: Load the external memory address pointer DPTR with 0x2000. Show an
alternative solution in which 8-bit operands are used.
Solution:

Explanation: Firstly, it is done by MOV instruction. In an alternative method, SFRs like


DPH and DPL are introduced and then use the MOV instruction Which actually combines
two 4-bit numbers and show them together.
Problem 4.6: How can a byte be transferred from the address pointed by R0 to register R2?
Page |7

Solution:

Explanation: Here, byte pointed by R0 can first be moved into A and then to R2.
Problem 4.7: Assuming PC to be 1000H, transfer the codes at 1000H to the internal RAM at
70H.
Solution:

Explanation: First load A with 20H. Then Use the MOVC instruction to first get the code
into A. From A, it loaded that into 70H.
Problem 4.8: Using DPTR, transfer the codes from 1000H and 1020H to addresses 7EH and
7FH in RAM.
Page |8

Solution:

Explanation: First, Load DPTR with 1000H and A with [Link] Use the MOVC
instruction to first get the code into A, from where it loaded into 7EH. With DPTR already
loaded, move 20H into A and Use MOVC instruction again and move A to 7FH.
Problem 4.9: Write a byte in SBUF into external data memory 0000H
Solution:

Explanation: Here MOV A, SBUF instruction is used as there is no direct instruction exist
for these types of problem.
Problem 4.10: Using DPTR, transfer the codes from 1000H and 1001H to external data
memory address 1000H and 1001H to show how we copy the codes from code memory in
ROM to external RAM.
Page |9

Solution:

Explanation: First, load DPTR with 1000H and A with 00H. Then Use MOVC instruction to
first get the code at 1000H into A. From A, we store byte into external memory at 1000H
because DPTR=1000H and we can use MOVX @DPTR, A . and then MOV instructions are
used to read the code and write into data memory.

You might also like