Compilation Errors on AMD RYZEN 5 Using GCC and NASM for Assembly Code
Why does this code in the app.asm file fail to compile on an
AMD RYZEN 5 processor
, using windows 10 64bit operating system
, with GCC
and NASM
as my assemblers, but it works perfectly on an online compiler
https://www.onlinegdb.com/online_gcc_assembler
which the code complied successful and gave the expected output of 17
?
When I compiled the code in the app.asm file using GCC
on the local machine AMD RYZEN 5
, It logged series of errors:
Check the vbnet output.txt file to see the error logs I got
Even compiling the code using NASM, It logged similar errors as shown in makefile output.txt file
What could I be missing in my local setup, and how can I resolve these errors?Solution:Jump to solution
Yes sure , I found out that the default output format for NASM is a 16 bit flat binary. And I can't use NASM to assemble it. So I would have to rewrite most of the instructions anyway to port it to Windows. Probably starting again from C compiler output for Windows instead of for GNU/Linux
Thanks...
4 Replies
@Marvee Amasi The issue you're facing when compiling your app.asm file locally on an AMD Ryzen 5 with Windows 10 could be due to several factors. While the code works fine in the online compiler, the differences in environment and configuration between the two setups might be causing the errors.
First, it could be a mismatch in GCC or NASM versions—your local versions may be outdated compared to the online compiler. Updating them might help.
Next, there could be platform differences, as the online compiler might be using Linux, while you're working on Windows. Assembly code can be sensitive to such differences, so double-check for platform-specific instructions.
Another possibility is that the flags or options you're using for assembling and linking might be incorrect. The online compiler might handle these automatically, but you may need to manually specify them, especially for architecture ( 32-bit vs 64-bit).
Lastly, it could be related to file paths or dependencies in your local setup. Make sure everything is correctly referenced and accessible.
To resolve this, review the error logs, check the versions of your tools, and ensure you’re targeting the correct architecture. You may also want to try compiling on a Linux machine or update your toolchain.
The issue with compiling your app.asm file locally likely comes from differences between your local setup and the online compiler. Possible causes include outdated GCC or NASM versions, platform differences (Windows vs. Linux), incorrect flags or options for assembling and linking, or file path issues. To fix it, update your compilers, check the architecture you're targeting (32-bit vs 64-bit), review the error logs, and ensure your setup is configured correctly.
@Marvee Amasi
Solution
Yes sure , I found out that the default output format for NASM is a 16 bit flat binary. And I can't use NASM to assemble it. So I would have to rewrite most of the instructions anyway to port it to Windows. Probably starting again from C compiler output for Windows instead of for GNU/Linux
Thanks