Problem – Write an assembly level language program to convert ASCII code to its respective HEX Code.
Input: DATA: 31H in memory location 2050 Output: DATA: 0BH in memory location 3050
Assume that starting address of program, input memory location, and output memory locations are 2000, 2050, and 3050 respectively.
- Input the content of 2050 in accumulator.
- Subtract 30H from accumulator.
- Compare the content of accumulator with 0AH.
- If content of accumulator is less than 0A then goto step 6 else goto step 5.
- Subtract 07H from accumulator.
- Store content of accumulator to memory location 3050.
- Terminate the program.
|2007||JC 200D||Check for carry|
- LDA 2050 load the content of memory location 2050 to accumulator.
- SUI 30H subtracts 30H immediately from accumulator.
- CPI 0AH compare immediately 0AH with the data of accumulator.
- JC 200D check for carry if yes then go to address 200D.
- SUI 07H subtracts 07H immediately from accumulator.
- STA 3050 store the content of accumulator to memory location 3050.
- HLT stops the execution of program.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- 8085 program to convert 8 bit BCD number into ASCII Code
- 8085 program to convert a hexadecimal number into ASCII code
- 8085 code to convert binary number to ASCII code
- 8086 program to convert 8 bit BCD number into ASCII Code
- 8085 program to convert an 8 bit number into Grey number
- 8085 program to convert an 8 bit BCD number into hexadecimal number
- 8085 program to separate (or split) a byte into two nibbles
- 8085 program to convert a BCD number to binary
- 8085 program to convert binary numbers to gray
- 8085 program to convert gray to binary
- 8086 program to convert 8 bit ASCII to BCD number
- 8085 program for Linear search | Set 2
- 8085 program to find the element that appears once
- 8085 program to find maximum and minimum of 10 numbers
- 8085 program to search a number in an array of n numbers
- 8085 program to find maximum of two 8 bit numbers
- 8085 program to add two 8 bit numbers
- 8085 program to multiply two 8 bit numbers
- 8085 program to find the factorial of a number
- 8085 program to count the number of ones in contents of register B
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.