How to debug codes

Programming, for all ages and all languages.
Post Reply
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

How to debug codes

Post by leetow2003 »

I write assembler including calling gate,and my compiler is masm5.0,
I run it in pure dos,but PC always restart,I want to debug codes,
who could tell me how to debug codes in detail?what tool do I use?
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Re: How to debug codes

Post by salil_bhagurkar »

Have you bothered checking the wiki out? It has articles on what tools you can use to do just what you've asked.
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

Re: How to debug codes

Post by leetow2003 »

salil_bhagurkar wrote:Have you bothered checking the wiki out? It has articles on what tools you can use to do just what you've asked.
Could you tell which article,or could you tell me the link address?
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

Re: How to debug codes

Post by leetow2003 »

I read some articles,and I find they are almost articles about debug OS,
but my code isn't OS,I compile my codes to exe file using masm5.1,
who could tell me how to do?
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: How to debug codes

Post by mariuszp »

this forum is called
OSDev forum
It's for people making operating systems. OS-unrelated questions don't go here...
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: How to debug codes

Post by Candy »

I would suggest you try general assembly coding forums first.

If you're working in Windows or DOS try to make a simple DOS program with assembly first. Find out how to make a COM program and make it do nothing, succesfully. Once that works, expand on it a small step at a time, finding out how to debug in the meantime.

As an alternative, if you know Visual Studio try writing your assembly code in "C" like so:

Code: Select all

int main() {
  asm {
    <your code goes here>
  }
}
That way, the program-wrapping is done for you and you can start it from Visual Studio with a debugger. This should also work in Visual C++ Express Edition.
Post Reply