Keshav Bansal started this conversation 9 months ago.
Why doesn't my assembly loop print any output on Windows x86_64 when assembled with NASM?
Why doesn't my assembly loop print any output on Windows x86_64 when assembled with NASM, and what might be causing this issue?
codecool
Posted 9 months ago
There could be several reasons why your assembly loop isn't printing any output on Windows x86_64 when assembled with NASM. Here are some common issues to check:
System Calls: Ensure you're using the correct system calls for Windows. Unlike Linux, Windows uses different system calls for I/O operations2.
Calling Conventions: Verify that you're following the correct calling conventions for Windows x86_64. Incorrect calling conventions can cause the program to crash or not behave as expected.
Printing Function: Make sure you're using the correct function to print output. For example, on Windows, you might need to use WriteConsole or printf from the C standard library.
Data Section: Check if the data section is correctly defined and initialized. Any issues here can prevent the loop from accessing the correct data.
Linking: Ensure that your assembly code is correctly linked with any necessary libraries. Missing libraries can cause unresolved symbols and prevent the program from running correctly.
Debugging: Use a debugger to step through your code and see where it might be failing. This can help pinpoint the exact issue.