$29.99
Write a program which does the disassembly process i.e. functions exactly opposite to Assembler.
Input Format
Input is provided through STDIN. Each line is a 16-bit HACK binary code. No Indentation, No comments NOTE: Input ends with new-line character. Eg:
• Firstly, there are 3 Sample test cases (visible) so that you can RUN and debug your program. These are worth 0 Points in total.
• Then, there are 3 Graded test cases (hidden) on which your program will be evaluated after clicking SUBMIT. These are worth 30 Points in total.
• Finally, there are 3 Bonus test cases (hidden) to check syntax errors (if any) and your program will be evaluated on these bonus tests cases after clicking SUBMIT. These are worth 4 Points in total. We are looking to detect only two kinds of syntax errors (if any) as follows. As soon as your program detects either of the syntax error first, it must immediately exit the program with the corresponding String type error message on STDOUT.
ERROR: illegal HACK instruction
ERROR: instruction bit size not 16
Output Format
1. Output must be symbol-less assembly statements as per HACK assembly reference sheet.
2. Recall, that your disassembler program has to output explicit addresses rather than displaying symbols. Why? Because, symbols is simply programming gimmick which we use to make our asm readable. For disassembler, it really has nothing to do with symbols in the reverse translation.
DISASSEMBLER