Convert assembly code to machine code

My question is: How do I find the machine code exchange instructions of the assembly code? And how to write a binary file that can be executed? Thanks.

+4
source share
4 answers

If you have assembly code and want to execute it, you first need to run it using assembler to create the binary. There are several assemblers available, I would recommend starting with NASM , as it is quite popular and works on several platforms.

Then, to build / link your program, simply run:

nasm -o object.o your-source-file.asm ld -s -o your-output-executable object.o 
+4
source

What assembly language are you using? This will determine the program that you use to compile the assembly code into machine code. If you publish an assembly code snippet, someone may identify it for you.

0
source

If you use Windows, just do the following: Go to Run and write cmd, then write debug write a100 then write any assembly instructions, then press enter, type r, then the machine code of your assembly instructions will appear on the left side of the Black Dos screen. I hope this helps some.

0
source

Use cc -S file_name.c

It will fill you with the build code of your program c

-1
source

Source: https://habr.com/ru/post/1302982/


All Articles