8086 program to convert binary to Grey code Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Prerequisite - Binary to/from Gray Code Problem - Write a program to convert Binary number to Grey code 8-bit number where starting address is 2000 and the number is stored at 2500 memory address and store result into 2600 memory address. Example – Algorithm – Move value at [2500] into AL Move AL into BL Logical shift right AL one time XOR BL with AL (Logically) and store into BL Move content of BL into 2600 Stop Program – Memory Mnemonics Operands Comment 2000 MOV AL, [2500] [AL] <- [2500] 2004 MOV BL, AL [BL] <- [AL] 2006 SHR AL, 01 Shift Right one time 2008 XOR BL, AL [BL] <- [BL] @ AL 200A MOV [2600], BL [2600] <- [BL] 200E HLT Stop Explanation – Registers AL, BL are used for general purpose MOV is used to transfer the data SHR is used to shift right (logically) up to counter is not zero XOR is used to exclusive-or of two values (logically) HLT is used to halt the program See for 8085 program to convert binary numbers to gray Comment More infoAdvertise with us Next Article 8085 program to convert ASCII code into HEX code U ujjwal57 Follow Improve Article Tags : Computer Organization & Architecture system-programming microprocessor Similar Reads 8085 program to convert gray to binary Problem â Write an assembly language program in 8085 microprocessor to convert gray numbers to binary. Example - Algorithm â Load the data from address 2050 in AMove the data 07 in CMove the data of A to BExtract the MSB (Most Significant Bit) of data available in ARotate the bits of A to rightTake 3 min read 8085 program to convert binary numbers to gray Prerequisite - Binary to/from Gray Code Problem â Write an assembly language program in 8085 microprocessor to convert binary numbers to gray. Example - Algorithm â Set the Carry Flag (CY) to 0.Load the data from address 2050 in A.Move the data of A(accumulator) into register B.Rotate the bits of A 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 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 8086 program to convert 8 bit BCD number into ASCII Code 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 2 min read 8085 program to convert an 8 bit number into Grey number Prerequisite - Binary to/from Gray Code Problem - Write an assembly language program in 8085 which convert an 8 bit number into grey number Example - Assumption - 8 bit number (input) is stored at memory location 2050 and output to be stored at memory location 3050. Algorithm - Load the content of m 2 min read Like