Lab 2 Microdigitaledcom
Lab 2 Microdigitaledcom
OBJECTIVES:
To examine and use an 8051 assembler.
To examine and use an 8051 simulator.
REFERENCE:
Mazidi and McKinlay, “The 8051 Microcontroller and Embedded Systems,” Chapter 2,
Appendix G.
MATERIALS:
8051 assembler and simulator from Franklin Software Inc., Keil Corporation, or the
assembler of your choice.
WEB SITES:
www.fsinc.com for Franklin Software
www.keil.com for Keil Corporation
ACTIVITY 1
Write and assemble a program to move value 99H to register A. Then from register A
move it to all registers R0 - R7. Use the simulator to single-step the program and examine the
registers.
ACTIVITY 2
Write and assemble a program to add all the single digits of your ID number and save the
result in R2. Pick 7 random numbers (all single digit) if you do not want to use your ID number.
Then use the simulator to single-step the program and examine the registers.
Lab Manual for “The 8051 Microcontroller and Embedded Systems” LAB 2
LAB 2
WORKSHEET
PC = A= B=
2. For Question 1, indicate the largest value (in decimal) that each register can contain.
PC = A= B=
3. For Question 1, indicate the largest value (in hex) that each register can contain.
PC = A= B=
4. Who generates each of the following files and what is the use of each.
.asm
.lst
.obj
.abs
.hex
LAB 2 Lab Manual for “The 8051 Microcontroller and Embedded Systems”