is there anything like PrintDec, PrintString, PrintStringByAddr, PrintHex, PrintText etc... for FASM like in MASM32?

Right now while converting code from MASM to FASM if my program produces an error I have to open ollydebug or use int 3 to open olly and view the values. It would be great if something existed for FASM.
Posted on 2003-05-14 19:12:39 by Gunner
Gunner, you are probably looking for an all-in-one solution like vkim's VKDEBUG. I do not think that such a tool exists (yet) for FASM.

For a macro to quickly check stuff like function return values, see the attached file. It is a slightly modified 'HELLO.ASM' from the FASM examples, with the macro built in.

Regards, Frank
Posted on 2003-05-14 21:44:13 by Frank
Here is my macros.inc:
;##########################################################################

; macros
;##########################################################################
macro showint caption,value {
local .over,.str
jmp .over
.str db caption," = %u",0
.over: pushad
mov ebx,value
stdcall [GlobalAlloc],GMEM_MOVEABLE+GMEM_ZEROINIT,1000h
push eax
push eax
stdcall [GlobalLock],eax
push eax
ccall [wsprintf],eax,OFFSET .str,ebx
pop eax
stdcall [MessageBox],0,eax,0,MB_OK+MB_ICONASTERISK+MB_APPLMODAL
call [GlobalUnlock]
call [GlobalFree]
popad
}
;##########################################################################
macro showhex caption,value {
local .over,.str
jmp .over
.str db caption," = %08Xh",0
.over: pushad
mov ebx,value
stdcall [GlobalAlloc],GMEM_MOVEABLE+GMEM_ZEROINIT,1000h
push eax
push eax
stdcall [GlobalLock],eax
push eax
ccall [wsprintf],eax,OFFSET .str,ebx
pop eax
stdcall [MessageBox],0,eax,0,MB_OK+MB_ICONASTERISK+MB_APPLMODAL
call [GlobalUnlock]
call [GlobalFree]
popad
}
;##########################################################################
macro showstr caption,value {
local .over,.str
jmp .over
.str db caption," = %s",0
.over: pushad
mov ebx,value
stdcall [GlobalAlloc],GMEM_MOVEABLE+GMEM_ZEROINIT,1000h
push eax
push eax
stdcall [GlobalLock],eax
push eax
ccall [wsprintf],eax,OFFSET .str,ebx
pop eax
stdcall [MessageBox],0,eax,0,MB_OK+MB_ICONASTERISK+MB_APPLMODAL
call [GlobalUnlock]
call [GlobalFree]
popad
}
;##########################################################################
macro showfmt fmtstr,[values] {
common local .over,.str,..size
jmp .over
.str db fmtstr,0
.over: pushad
stdcall [GlobalAlloc],GMEM_MOVEABLE+GMEM_ZEROINIT,1000h
push eax
push eax
stdcall [GlobalLock],eax
push eax
..size = 8
reverse
pushd values
..size = ..size+4
common
push OFFSET .str
push eax
call [wsprintf]
add esp,..size
pop eax
stdcall [MessageBox],0,eax,0,MB_OK+MB_ICONASTERISK+MB_APPLMODAL
stdcall [GlobalUnlock]
stdcall [GlobalFree]
popad
}
;##########################################################################
macro msgbox value {
pushad
stdcall [MessageBox],0,value,0,MB_OK+MB_ICONASTERISK+MB_APPLMODAL
popad
}
;##########################################################################


Use like:
showint "eax", eax

showstr "data", edx
showhex "ecx", ecx
showfmt "esi = %u, edi = %u", esi, edi
msgbox esi


Some registers will not work for showfmt macro.
Posted on 2003-05-14 21:58:38 by comrade
Thank you. This will help
Posted on 2003-05-15 06:46:42 by Gunner