In: Computer Science
Assembler translates assembly language to machine language instructions and Disassembler translates machine language to assembly language. 8086 emulator shows both machine language bytes and disassembler output while running a program and it also shows the original assembly code.The disassembled code is difficult to read than the original assembly language program, because some things are missing or it may be incorrect. The missing terms in disassembly code is constants and comments.
Disassembler is actually the inverse of assembler. The output of disassembler is often formatted for human readablilty.
Because when an assembly language is converted into machine language by an assembler,constants and comments are removed from the assembled machine language. So when a disassembler works on these machine language ,it produce an assembly code which lacks constants ad comments User defined textual identifiers such as variables,labels and macros are removed by the assembler. These comments made the program easy t o understand and it gives some information about the purpose of the code.
In disassembler it is difficult to separate code from data. Data may be inserted into the code section or code may be inserted in the data section. It is not possible for all input programs.