8086 program to convert 8 bit ASCII to BCD number
Problem – Write a program to convert ASCII to BCD 8-bit number where starting address is 2000 and the number is stored at 2050 memory address and store result into 3050 memory address.
Example-
Input : location: 2050
Data : 37
Output : location: 3050
Data : 07
Algorithm –
- Move value at [2050] into AL
- Perform AND operation on AL with 0F
- Move content of accumulator AL into 3050
- Stop
Program –
| Memory | Mnemonics | Operands | Comment |
|---|---|---|---|
| 2000 | MOV | AL, [2050] | [AL] <- [2050] |
| 2004 | AND | AL, 0F | [AL] <- ([ AL] AND 0F ) |
| 2006 | MOV | [3050], AL | [3050] <- [AL] |
| 200A | HLT | Stop |
Explanation – Registers AL is used for general purpose
- MOV is used to transfer the data
- AND is used for multiplication (logically)
- HLT is used to halt the program
Recommended Posts:
- 8086 program to convert 8 bit BCD number into ASCII Code
- 8086 program to convert a 16 bit decimal number to binary
- 8086 program to convert a 16 bit decimal number to Hexadecimal
- 8086 program to convert a 16 bit Decimal number to Octal
- 8085 program to convert 8 bit BCD number into ASCII Code
- 8085 program to convert a hexadecimal number into ASCII code
- 8086 program to convert an 8 bit BCD number into hexadecimal number
- 8086 program to convert binary to Grey code
- 8085 program to convert ASCII code into HEX code
- 8085 code to convert binary number to ASCII code
- 8086 program to search a number in a string
- 8086 program to reverse 8 bit number using 8 bit operation
- 8086 program to reverse 16 bit number using 8 bit operation
- 8086 program to Print a 16 bit Decimal number
- 8086 program to find sum of digits of 8 bit number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.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.
Improved By : Ankit_Bisht



