i'm was studying about cpu architetures for study the assembly language, but i have this doubt because many tutorials on yt i see peoples using a based Linux distribution to create, compile,and run assembly code.
can you help me? thanks!
I'm was trying to compile the .asm using the NASM, bt when i run it, it "sleep" for seconds and stop the execution, i'm was seeing and try testing with Mingw, but has the same problem.
i'm was searching in very sites and videos but i can't find it
i'm try using: nasm -f win32 App.asm
and gcc App.obj -o App.exe
to compile it to an exe
and .\App.exe
to run
CodePudding user response:
Yes, you can use Windows to compile and run assembly code. To compile your .asm file using NASM on Windows, you can use the following command:
nasm -f win32 App.asm
To create an executable file from the object file generated by NASM, you can use the gcc compiler with the following command:
gcc App.obj -o App.exe
Once the executable file has been created, you can run it using the following command:
.\App.exe
If you are encountering an issue where the program "sleeps" for a few seconds and then stops execution, it may be due to an error in the assembly code or an issue with the compiler. It is recommended to carefully review the code and try using a different compiler to see if the issue persists.