As you have seen in the previous labs an assembler is a prog
As you have seen in the previous labs, an assembler is a program that converts a mnemonic representation of a computer\'s instructions into the corresponding machine language. A disassembler, on the other hand, takes a binary file as its input and prints out the corresponding assembly code. In this lab, you are to write a simple disassembler for the LC-3.
Your program should prompt the user for an input, which you can assume will always be four hexadecimal digits preceded by an \'x\' character. Your program should then print out the assembly language that corresponds to this hexadecimal number when it is interpreted as one LC-3 machine instruction. For instance, if the user types “x14a6”, your program should print “add r2 r2 0x0006” or “add r2 r2 0x6.” Your program should then prompt the user for another input and repeat the entire process. The program should terminate when the user types a “q” character.
Your program must follow the assembly language programming style guidelines. You must demonstrate appropriate use of structured programming techniques, including the use of subroutines. You may find the ASCII-to-binary conversion routine you wrote for the previous lab to be helpful in writing this disassembler.
Solution
Step 1: You get the assembly code reference, particularly you will need to know which mnemonic corresponds to which machine code
