8086 program to convert 8 bit BCD number into ASCII Code Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Problem – Write an assembly language program in 8086 microprocessor to convert 8-bit BCD number to its respective ASCII Code. Assumption – Starting address of the program: 400 Input memory location: 2000 Output memory location: 3000 Example : Input: DATA: 98H in memory location 2000Output:DATA: 38H in memory location 3000 and 39H in memory location 3001 Algorithm – Load contents of memory location 2000 in register AL Copy contents of register AL in register AH Perform AND operation on register AL with 0F Assign 04 to CL Register Shift the contents of AH by executing SHR instruction using CL Perform OR operation on register AX with 3030 Store the content of AX in memory location 3000 Program - Memory AddressMnemonicsComments400MOV AL, [2000]AL<-[2000]404MOV AH, ALAH<-AL406AND AL, 0FAL <- (AL AND 0F)408MOV CL, 04CL <- 0440ASHR AH, CLShift AH content Right by 4 bits(value of CL)40COR AX, 3030AX <- (AX OR 3030)40FMOV [3000], AX[3000]<-AX413HLTStop ExecutionExplanation – MOV AL, [2000]: loads contents of memory location 2000 in AL MOV AH, AL: copy contents of AL in AH AND AL, 0F: do AND operation on AL with 0F MOV CL, 04 assign 04 to CL register SHR AH, CL: shift the content of AH register right by 4 bits i.e. value of CL register OR AX, 3030: do OR operation on AX with 3030 MOV [3000], AX: stores the content of AX register pair in 3000 memory address HLT: stops executing the programAdvantages:It can be implemented in low-level programming languages such as assembly language, providing a high level of control over the hardware and the ability to optimize the code for specific applications. It can be used in embedded systems and other applications where hardware resources are limited, as the 8086 microprocessor is a simple and low-cost device. It can perform BCD-to-ASCII conversions on other types of data, such as arrays or memory locations, providing a versatile tool for manipulating data. Disadvantages:It can be a complex and error-prone process, requiring a sequence of instructions to be executed in a specific order and careful handling of register values. It may not be as fast or efficient as dedicated BCD-to-ASCII conversion hardware or software libraries on more advanced microprocessors. It may require specialized knowledge and programming skills to implement and optimize, as the sequence of instructions can be complex and the conversion table may need to be customized for specific applications. Comment More infoAdvertise with us Next Article 8086 program to convert 8 bit ASCII to BCD number A Ankit_Bisht Follow Improve Article Tags : Computer Organization & Architecture system-programming ASCII microprocessor Similar Reads 8085 program to convert 8 bit BCD number into ASCII Code Problem â Write an assembly-level language program to convert 8-bit BCD number to its respective ASCII Code. Assumptions - Starting address of program: 2000 Input memory location: 2050 Output memory location: 3050 and 3051 ASCII Code for Digits 0 â 9 Example - Algorithm -  Input the content of 20 3 min read 8086 program to convert 8 bit ASCII to BCD number Problem - Write a program to convert ASCII to BCD 8-bit number where the starting address is 2000 and the number is stored at 2050 memory address and store result in 3050 memory address. Example-Input : location: 2050 Data : 37Output : location: 3050 Data : 07 Algorithm â Move value at [2050] into A 1 min read 8085 program to convert ASCII code into HEX code Problem - Write an assembly level language program to convert ASCII code to its respective HEX Code. Examples: Input: DATA: 31H in memory location 2050Output:DATA: 0BH in memory location 3050 Assume that starting address of program, input memory location, and output memory locations are 2000, 2050, 1 min read 8085 program to convert a hexadecimal number into ASCII code Problem: Write an assembly-level language program to convert the HEX code to its respective ASCII code. Assume that the starting address of the program and input memory location are 2000 and 2050 respectively. Example: Input: 2050 E4 (Hex data)Output:2051 34 (ASCII code for 4)2052 45 (ASCII code for 2 min read 8086 program to convert an 8 bit BCD number into hexadecimal number Problem - Write an assembly language program in 8086 microprocessor to convert an 8 bit BCD number into hexadecimal number. Example - Assumption - Initial value of segment register is 00000. Calculation of physical memory address: Memory Address = Segment Register * 10(H) + Offset where Segment Regi 2 min read 8085 program to convert a BCD number to binary Problem â Write an assembly language program for converting a 2 digit BCD number to its binary equivalent using 8085 microprocessor. Examples: Input : 72H (0111 0010)2Output : 48H (in hexadecimal) (0011 0000)2((4x16)+(8x1))=72Algorithm: Load the BCD number in the accumulatorUnpack the 2 digit BCD nu 2 min read Like