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:
- Step 1: Load the ASCII number from the location.
- Step 2: Check for the digit or alphabet.
- Step 3: Using suitable logic and instructions convert the ASCII number into Hexadecimal.
- Step 4: Add the two converted values.
- Step 5: Display the result.
- Step 6: Stop.
Program:
| Address | Label | Mnemonics | Operand | Comment |
|---|---|---|---|---|
| 4100 | LDA | 4500 | Load the memory content to Accumulator | |
| 4103 | SUI | 30 | Subtract with 30 | |
| 4105 | CPI | 0A | Compare with 0A | |
| 4107 | JC | SKP | If carry skip | |
| 410A | SUI | 07 | Subtract with 07 | |
| 410C | SKP | STA | 4201 | Store Accumulator content |
| 410F | HLT | Stop |
Observation:
- Input:
- Address
4200:41
- Address
- Output:
- Address
4201:0A
- Address
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:
- What is the Hexadecimal for (35) ASCII?
- What is the purpose of branch instructions in 8085 microprocessor?
- Define one’s complement of an 8-bit numbers.
- What is the function of CMA instruction?
- What is the logic behind the conversion of ASCII number into Hexadecimal number?
- Give example for Machine control instruction?
- 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