Reputation: 394
So the other day and a friend told me I need to use Visual Studio to debug my x86 assembly code. It should help me out a lot.
How the code is set up right now is that I have a build.bat file that compiles, links, and executes my project.
I have created a procedure.asm file that I want to step through to check for issues. I have been doing research on debugging in Visual Studio, but I can't figure out how to do it (I've never used a debugger). Can anyone help me figure out how to use the debugger in Visual Studio for a x86 Assembly project? There are multiple header files and .asm files with one driver.
Thanks for the help. I have no idea how to use a debugger for assembly. Ive used eclipse debugger for java, never used visual studio. I have downloaded visual studio code
Upvotes: 0
Views: 1048
Reputation: 578
I am using Visual Studio 2015 Community, and found out the easiest way to add headers and assembly files is through 'Solution Explorer' (Under 'View' of the top), and then you can add files by right click and select 'add'.
However, if you want to debug the code, I found a source might be helpful: Guide to Using Assembly in Visual Studio .NET
Hope this helps!
Upvotes: 2
Reputation: 1385
The steps below have worked with older versions of Visual Studio (i.e. 6.0 and 7.x) and likely still work, although I'm not sure which version of Visual Studio you are using.
1> invoke Visual Studio with the /debugexe argument followed by the name of your assembly language program and any command line arguments you want to pass; e.g.:
devenv.exe /debugexe asm_app.exe
2> Once started, Visual Studio will prompt to create a .SLN file with the same base name of the .EXE; essentially this will hold your project settings.
3> Add the .ASM source files to Solution Explorer (right-click -> "Add Existing...") so the debugger can easily find the source code; this also allows you to conveniently set breakpoints.
4> To begin your debugging session, right click the EXE project name in Solution Explorer and then select "Debug" -> "Start New Instance".
Upvotes: 0