Page 1 of 1

How to debug codes

Posted: Fri May 06, 2011 8:37 pm
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?

Re: How to debug codes

Posted: Fri May 06, 2011 9:50 pm
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.

Re: How to debug codes

Posted: Sat May 07, 2011 5:03 am
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?

Re: How to debug codes

Posted: Sat May 07, 2011 9:05 am
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?

Re: How to debug codes

Posted: Sat May 07, 2011 11:01 am
by mariuszp
this forum is called
OSDev forum
It's for people making operating systems. OS-unrelated questions don't go here...

Re: How to debug codes

Posted: Thu May 12, 2011 3:23 am
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.