Experiment 5 — Hex-to-Decimal-to-ASCII Conversion
Task:
Write a program to read a byte from port P1, convert the hex byte to its decimal digits, convert those digits to ASCII, and store the ASCII bytes in RAM starting at 40H.
Example:
- If
P1 = 0FBH(decimal 251), the stored ASCII bytes at40H.. will be32H,35H,31H(characters2,5,1).
Program:
T1E5P1.asmimplements the conversion and writes ASCII bytes starting at RAM location40H.
Usage:
- Set
P1in the simulator to the desired input value (e.g.,0FBH). - Assemble and single-step
T1E5P1.asmand inspect RAM starting at40H.