Friday, October 2, 2026

ASCII to Hexadecimal conversion | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To write an assembly language program to convert the given ASCII number into its Hexadecimal equivalent and to verify the result.

Apparatus Required: 8085 microprocessor kit, keyboard.

Algorithm:

  1. Step 1: Load the ASCII number from the location.
  2. Step 2: Check for the digit or alphabet.
  3. Step 3: Using suitable logic and instructions convert the ASCII number into Hexadecimal.
  4. Step 4: Add the two converted values.
  5. Step 5: Display the result.
  6. Step 6: Stop.

Program:

AddressLabelMnemonicsOperandComment
4100LDA4500Load the memory content to Accumulator
4103SUI30Subtract with 30
4105CPI0ACompare with 0A
4107JCSKPIf carry skip
410ASUI07Subtract with 07
410CSKPSTA4201Store Accumulator content
410FHLTStop

Observation:

  • Input:
    • Address 4200: 41
  • Output:
    • Address 4201: 0A

Result: Thus assembly language program to convert the given ASCII number into its Hexadecimal equivalent is completed and also the result is verified.

Flowchart:

               +-------------------------------+
               |             START             |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |     Load the ASCII number     |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |  Convert ASCII into Hexa-     |
               |      decimal equivalent       |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |      Display the result       |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |             STOP              |
               +-------------------------------+

Viva Questions:

  1. What is the Hexadecimal for (35) ASCII?
  2. What is the purpose of branch instructions in 8085 microprocessor?
  3. Define one’s complement of an 8-bit numbers.
  4. What is the function of CMA instruction?
  5. What is the logic behind the conversion of ASCII number into Hexadecimal number?
  6. Give example for Machine control instruction?
  7. What is the need of code conversion?


For all 2026 published articles list: click here: 

…till the next post, bye-bye & take care

No comments:

Post a Comment