views:

200

answers:

4

Hi everybody.. My Question is How can I know the exchangeable machine code of the instructions of the assembly code? And how to write a binary file that can be executed? Thanks.

A: 

Use cc -S file_name.c

It will populate you assembly code of your c program

pavun_cool
OP didn't mention a C compiler, remark is only confusing
Marco van de Voort
+2  A: 

If you have a piece of assembly code and want to execute it, you will first need to run it through an assembler to produce a binary. There are a number of assemblers available, I would recommend starting with NASM since it's pretty popular and runs on several platforms.

Then, to assemble/link your program, just run:

nasm -o object.o your-source-file.asm
ld -s -o your-output-executable object.o
Martin
A: 

What assembly language are you using? That will determine the program you use to compile the assembly code into machine code. If you post a snippet of your assembly code, someone may be able to identify it for you.

Chadversary
A: 

If you Using Windows just do the next: Go to Run and write cmd then write debug write a100 then write any assembly instruction then press enter, write r , then machine code of your assembly instruction will appear on the left side of the black Dos screen. I hope it help some.

AlgoNotation