-2

I have a program in 8086 and C languages now i want to compare the machine code of each program. How can I get machine code of C and assembly 8086 code

I use emu8086 and DEV .

Jeffrey Bosboom
  • 13,313
  • 16
  • 79
  • 92
user63835
  • 29
  • 7
  • 5
    Ermm ... C implementations don't use bytecode. Bytecodes refer to instructions of a portable abstract machine (e.g. the JVM, Dalvik, CLI). C tool chains compile to real machine code. Please correct your question to clarify what you are actually asking here. – Stephen C Jan 23 '15 at 23:58
  • 1
    i changed my question.@stephenC – user63835 Jan 24 '15 at 00:10
  • If it is your own ASM and C code you can get an assembly output from your C compiler and compare it with the ASM source code. But if you are trying to reverse-engineer somebody else's stuff, it's unlikely you'll get specific help. – Weather Vane Jan 24 '15 at 00:43

1 Answers1

0

How can I get machine code of C and assembly 8086 code

Compile the C code using the standard compiler

Assemble the C code using the standard assembler

That gives you the machine code.

Then, assuming you are really wanting to compare the code ... :

  • use a hex dump tool to look at / compare the two code files, or

  • use a disassembler and compare the dissasembled versions of the C code with your original assembly code, or

  • look up in your compiler documentation how to get it to output assembly language ...

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Don't ask me to recommend specific tools. That is off-topic, and I won't answer. – Stephen C Jan 24 '15 at 00:25
  • Sure, software recommendations are off-topic, but that doesn't mean you can't point to them in your answer. i.e, it wouldn't be off topic to mention `objdump`. –  Jan 24 '15 at 00:26
  • If you want write your own answer, please feel free. However, I don't want any recommendations in my answer for the very same reason that that requests for recommendations are off-topic. IMO, the OP is better off doing his own research. – Stephen C Jan 24 '15 at 00:31