You are on page 1of 9

MICROPROCESSORS

EXPERIMENT NO. 1

FAMILIARIZATION WITH THE


EdSim51 SIMULATOR AND

m
er as
THE 8051 INSTRUCTION SET

co
eH w
o.
rs e
ou urc
o

Name: Ascan, David Angelo C.


aC s
v i y re

Course/Section:CPE108L/E02
ed d
ar stu

Group No.: 1
sh is
Th

Date of Performance: May 28, 2020


Date of Submission: May 28, 2020

Engr. Cyrel Manlises


Professor

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
PART ONE: Familiarization with the simulator
Q1. What are the contents of the registers A, R6, and R0?

A = 0x19 R6 = 0x09 R0 = 0x19

Q2. What is the output of the program? What do you think is the
effect of the changes you have made in the program?

It has the same output. There seems no effect

m
because the value 256 can't be expressed in two

er as
bits of hexadecimal as it is 100H which has 3

co
eH w
digits. It will instead give the result of 0x00.

o.
rs e
ou urc
Q3. What are the added instructions to the new program?
o
aC s
v i y re

MOV B, #3CH

ADD A, B
ed d
ar stu

Q4. What is the output of the program?


sh is

A = 0x55 B = 0x3C R0 = 0X19 R6 = 0X09


Th

Q5. What will happen if the destination of the sum is changed to


R0? Explain your answer.

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
If the destination of the ADD is changed to R0, it
will give syntax error since the destination of
ADD should not be the temporary register.
Instead, if we can add the code MOV R0, A to
copy the result of the sum from register A for R0
to be the destination.

PART TWO: Exploring the Instruction Set of 8051


Q1-II. What is the output of the program? Complete the given
table 1.
TABLE 1

m
er as
ROM address Assembly Language Result

co
0000 CLR A Acc=0X00

eH w
0001 MOV R5, #35H R5=0X35

o.
0003
rs e MOV R7, #45H R7=0X45
ou urc
0005 MOV A, #0 Acc=0X00
0007 ADD A, R5 A=0X00
o
aC s

0008 ADD A, R7 A=0x35


v i y re

0009 ADD A, #27H A=0x7A


ed d

Q2-II. Go to code memory and complete table 2.


ar stu

TABLE 2
ROM Assembly Machine Byte Size of the
Address Language Language instruction
sh is

(OpCode)
Th

0000 CLR A E4 1
0001 MOV R5, #35H 7D 35 2
0003 MOV R7, #45H 7F 45 2
0005 MOV A, #0 74 00 2
0007 ADD A, R5 2D 1
0008 ADD A, R7 2F 1
0009 ADD A, #27H 24 27 2

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
Q3-II. What is the total number of bytes of the program?

11

Q4-II. What is corresponding value of each flag in PSW?


Complete table 3.
TABLE 3:PSW
CY AC F0 RS1 RS0 OV -- P
0 1 0 0 0 1 0 1

m
er as
Q5-II. Complete table 4 and 5 to RAM locations content.

co
TABLE 4

eH w
RAM 0x18 0x19 0x1A 0x1D 0x1F

o.
Locations
rs e
ou urc
Content 0x50 0x60 0x70 0x90 0x80
TABLE 5
0x10 0x11 0x12 0x15 0x17
o

RAM
aC s

Locations
v i y re

Content 0x50 0x60 0x70 0x90 0x80


ed d
ar stu
sh is
Th

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
ar stu
sh is
Th

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
ar stu
sh is
Th

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
ar stu
sh is
Th

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
DICUSSION
In experiment, the focus was on the general
principle of a microcontroller and the 8051
instruction set. We’ve discussed on how to know
the contents on a certain registers, the parts of
the EdSim51 Simulator, and its instructions set. It
also allows us to write simple assembly language

m
er as
co
commands to the EdSim51 simulator.

eH w
o.
rs e
ou urc
In the part two of the experiment we have
discussed on how to locate the contents of the
o
aC s
v i y re

register in the RAM. Different type of basic


assembly instructions, addressing, and registers
ed d

were also learned in this experiment,


ar stu
sh is
Th

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
CONCLUSION
At the end of this experiment, we have

gained the basic understanding on the general

principles of a microcontroller and also its

simulator EdSim51. A microcontroller is a

m
integrated circuit that is designed to do a specific

er as
co
eH w
operation. It includes a processor, memory,

o.
rs e
ou urc
input/output interface, data & address bus on a
o

single chip. A microcontroller can do specific


aC s
v i y re

operations like add, subtract, load & move, and


ed d

operands. These commands or instructions can


ar stu

specify its memory addresses through addressing


sh is
Th

modes. I’ve learned how to add up and move

contents in the registers and identify its output.

I’ve also learned the location of the contents in

the RAM.

This study source was downloaded by 100000765504945 from CourseHero.com on 08-23-2021 17:40:15 GMT -05:00

https://www.coursehero.com/file/71554106/DavidAscan-CPE108LE02-Experiment1docx/
Powered by TCPDF (www.tcpdf.org)

You might also like