Monday, December 27, 2010

Assembly Debugger

For quite a some time I fell in love with Assembly programming language and now it is my favorite language. it is powerful easy and with assembly I get to know lot about computer architecture and the internal work very well. I am currently doing a project as a hobby implementing thumb and fore finger interface algorithm in assembly and writing a multi touch mouse driver in assembly but last few weeks and until the end of January I don’t have much time to deal with my loving language because of some hectic web projects and university exams.
so today for those who like assembly I will explain how to use assembly debugger if you are a newbie you will need this. this is one of the things I learnt in order to get familiar with assembly.in fact you already know the command prompt. so with windows you can use this debug tool debug.exe which installed with windows without doing any downloads or installings. open a windows command prompt and type debug. then type a100 and press enter
Untitled
here “a”(assemble) is a command and 141A:0100 is the memory location that we are going to enter our code in fact 141A is the segment and 0100 is the memory location inside the segment. you may get a different segment.. now insert this code :

mov ax,0001
mov bx,0010 
add ax,bx 
int 20 

after entering the above code press enter twice to tell the debugger that you have entered the code.this code is simply add two numbers. if you want to see what are the values inside all the registries when executing each instruction use “t” command. as you can see here after the execution the accumulator (AX) has 0011 value. in order to see the value of a given registry use “r” command with the register. 
Untitled
to run a program use “g” command and to go out from debugger use “q” command.
there are some more commands associated with debugger but I think this is enough to get started for any problem don’t hesitate to comment below..
cheers !!
Kesh….