0% found this document useful (0 votes)
19 views2 pages

Lab 6A BCD To Ascii Conversion: Lab Manual For "The 8051 Microcontroller ."

This document provides instructions for an activity to write a program that converts packed BCD data from switches on an 8051 trainer to two ASCII numbers displayed on LEDs with a 5 second delay between each display. The objective is to write a program that performs BCD to ASCII conversion. Materials needed include an 8051 Keil assembler and an 8051 trainer. Many devices provide time and date in packed BCD format, so conversion to ASCII is needed for display.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Lab 6A BCD To Ascii Conversion: Lab Manual For "The 8051 Microcontroller ."

This document provides instructions for an activity to write a program that converts packed BCD data from switches on an 8051 trainer to two ASCII numbers displayed on LEDs with a 5 second delay between each display. The objective is to write a program that performs BCD to ASCII conversion. Materials needed include an 8051 Keil assembler and an 8051 trainer. Many devices provide time and date in packed BCD format, so conversion to ASCII is needed for display.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

LAB 6A

BCD TO ASCII CONVERSION


OBJECTIVE:
To write a program to perform BCD to ASCII conversion.
REFERENCE:
Mazidi and McKinlay, The 8051 Microcontroller , Chapter 6.
MATERIALS:
8051 Keil assembler .
MDE8051 Trainer
Many devices such as GPS and RTC (real timer clock) provide the time and
date in packed BCD. To display these data, we must convert them to
ASCII.
ACTIVITY 1
Connect the pins of P1 to DIP switches on 8051 Trainer. Then, write a
program to convert the packed BCD data on switches to two ASCII numbers
and display them on P2 LEDs with 5 seconds delay in-between each
showing.

Lab Manual for The 8051 Microcontroller .

LAB 6A
WORKSHEET

Name:

Date:

Class:

1. Find the value in A, the accumulator, after the following code.


MOV A,#45H
ANL A,#0F
A=

in hex

2. Find the value in A, the accumulator, after the following code.


MOV A,#45H
ANL A,#0F0
A=

in hex

3. In the absence of the "SWAP A" instruction, how would you perform the
operation?

4. Can the SWAP instruction work on any register?


5. Find the value in A after the following code.
CLR A
ORL A,#66H
A=

in hex

6. Find the value in A after the following code.


CLR
CPL
ANL
A=

A
A
A,#99H
in hex

Lab Manual for The 8051 Microcontroller .

You might also like