Thursday, October 1, 2026

Hexadecimal to ASCII conversion | 8085 Lab Program

 Section: Array Operations & Code Conversions

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

Apparatus Required: 8085 microprocessor kit, keyboard.

Algorithm:

  1. Load the Hexadecimal number from the location.
  2. Separate the nibbles.
  3. Convert each nibble to its ASCII Equivalent.
  4. Add the two converted values.
  5. Display the result.
  6. Stop.

Program:

AddressLabelMnemonicsOperandComment
4100LDA4200Get the data
4103MOVB, AMove Accumulator content to B reg
4104ANI0FMask upper nibble
4106CALLSUBGet ASCII code for upper nibble
4109STA4201Store the value of accumulator
410BMOVA, BMove B reg content to Acc
410DANIF0Mask lower nibble
410FRLCRotate left without carry 4 times
4110RLC
4111RLC
4112RLC
4113CALLSUBGet the ASCII code
4116STA4202Store the accumulator
4119HLTStop
411ASUBCPI0ACompare with 0A
411CJCSKPSkip if carry
411FADI07Add 07 to Acc
4121SKPADI30Add 30 to Acc
4123RETReturn

Observation:

  • Input:
    • Address 4200: A5
  • Output:
    • Address 4201: 35
    • Address 4202: 41

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

Flowchart:

               +-------------------------------+
               |             START             |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |  Load the Hexadecimal number  |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |   Convert each nibble into    |
               |       ASCII equivalent        |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |      Display the result       |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |             STOP              |
               +-------------------------------+

Viva Questions:

  1. What is ASCII number for 0AH?
  2. What is difference between byte and word?
  3. What is the immediate addressing mode?
  4. What are data transfer instructions?
  5. What is the use of immediate addressing mode?
  6. What are branching instructions?
  7. What is DMA?


For all 2026 published articles list: click here: 

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