flat assembler
Message board for the users of flat assembler.

Index > DOS > Fasm debugging

Author
Thread Post new topic Reply to topic
Juhas



Joined: 23 Apr 2012
Posts: 4
Juhas 29 Apr 2012, 11:36
Hi, what is the best way to debug fasm? Of course it should be free(for non commercial use).
Post 29 Apr 2012, 11:36
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1619
Location: Toronto, Canada
AsmGuru62 29 Apr 2012, 11:59
I use OLLYDBG.
I also use the INT3 command to stop at some line.
After debugging is over -- INT3 instruction is removed.
Of course, I need to rebuild the code, but FASM is very fast.
Post 29 Apr 2012, 11:59
View user's profile Send private message Send e-mail Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 29 Apr 2012, 13:13
Visual Studio (including free express edition) also allow you to debug by placing int3 in the code and then selecting the debug option. After that, you can set up data*/code debug locations and use the debug context to rerun as many times as needed around re-assembly.

*Express version does not provide data break points
Post 29 Apr 2012, 13:13
View user's profile Send private message Reply with quote
Juhas



Joined: 23 Apr 2012
Posts: 4
Juhas 29 Apr 2012, 13:31
Unfortunately OllyDBG cannot read MZ files. Can you give me some clues about int 3? I tried to use it but it occured that I don't know how.
Post 29 Apr 2012, 13:31
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 29 Apr 2012, 14:03
int3 is a special one byte encoding for the int 0x03 instruction and can simply be assembled into the source code:
Code:
mov eax,dword [num]
mov ebx,dword [den]
xor edx,edx
int3 ; software breakpoint
mul ebx    
When you run the assembled code, whatever debugger you use, the debugger should halt on the int3 instruction and allow you to then step through execution and inspect the processor state.
Post 29 Apr 2012, 14:03
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1619
Location: Toronto, Canada
AsmGuru62 29 Apr 2012, 14:30
@Juhas: I see... you need 16-bit debugger then.
Google "16bit dos debugger" -- it is possible you'll get some good hits.
However, MZ is an old technology.
In my opinion Turbo Debugger is the best for MZ files.
Try here:
http://www.winprog.org/tutorial/bcpp.html
Post 29 Apr 2012, 14:30
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 29 Apr 2012, 23:25
Moved to DOS. MZ info is more appropriate here.
Post 29 Apr 2012, 23:25
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 30 Apr 2012, 22:53
"Best" is relative. Try GRDB or DebugX or even OpenWatcom's WD.
Post 30 Apr 2012, 22:53
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 15 Jun 2012, 03:33
There is a recent discussion http://board.flatassembler.net/topic.php?t=13973 and a FAQ on this http://board.flatassembler.net/topic.php?p=106203#106203 Smile

rugxulo wrote:

> Try GRDB or DebugX or even OpenWatcom's WD

Does it work with FreeDOS now ?
Post 15 Jun 2012, 03:33
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 05 Jul 2012, 21:19
>> Try GRDB or DebugX or even OpenWatcom's WD
>
> Does [WD] work with FreeDOS now ?

I honestly don't know as I'm not familiar with WD. If it doesn't, please feel free to report it (yes, again) to one of the FreeDOS mailing lists (and not the bugtracker, which apparently nobody reads).
Post 05 Jul 2012, 21:19
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 06 Jul 2012, 11:06
There was a similar thread in the very early days of this board, in which I recommended my personal favorite from the DOS times:
http://board.flatassembler.net/topic.php?t=17
As I recall, it was even able to emulate 386 processor in case other debugging techniques were not appropriate.

PS Wow, that thread has id 17, it was really one of the first threads here.
Post 06 Jul 2012, 11:06
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 24 Sep 2012, 07:08
> PS Wow, that thread has id 17, it was really one of the first threads here

2003-Jun-18 ... but both links are dead Sad
Post 24 Sep 2012, 07:08
View user's profile Send private message Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 204
ACP 24 Sep 2012, 11:16
Since it is wise to assume that FASM is run on modern hardware it is also feasible to use emulators like Bochs or Qemu or even great x86emu ida plugin (but this one requires IDA licence).

If you are referring to CUP386/CodeDigger than this link is working:
ftp://ftp.sac.sk/pub/sac/pack/ucfcup34.zip
Post 24 Sep 2012, 11:16
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.