ASCII TO HEX CONVERSION

To convert given ASCII Character into its equivalent Hexa Decimal number using
8085 instruction set.

ALGORITHM:
1. Load the given data in A- register
2. Subtract 30 H from A – register
3. Compare the content of A – register with 0A H

4. If A < 0A H, jump to step6. Else proceed to next step.
5. Subtract 07 H from A – register
6. Store the result
7. Terminate the program

PROGRAM:
LDA 4500
SUI 30
CPI 0A
JC SKIP
SUI 07
SKIP: STA 4501
HLT

OBSERVATION:
Input: 4500 31
Output: 4501 0B
ASCII TO HEX CONVERSION ASCII TO HEX CONVERSION Reviewed by enakta13 on August 20, 2012 Rating: 5

Search your question

Powered by Blogger.