ASCII to HEX Conversion program in 8085 – PhysicsTeacher
In this post, we will see how to convert a given ASCII Character into its equivalent Hexa Decimal (HEX) number using the 8085 microprocessor program or instruction set.
Algorithm for ASCII to HEX Conversion with 8085 microprocessor
- Load the given data in A register
- Subtract 30 H from A register
- Compare the content of A register with 0A H
- If A < 0A H, jump to step6. Else proceed to next step.
- Subtract 07 H from A register
- Store the result
- Terminate the program
8085 Program to convert ASCII to Hexa Decimal number | ASCII to HEX program code in 8085
LDA 4500
SUI 30
CPI 0A
JC SKIP
SUI 07
SKIP: STA 4501
HLT
Observation
Input: 4500 31
Output: 4501 0B
Result
Thus the given ASCII character was converted into its equivalent Hexa Value using the 8085 microprocessor program.