I tried to convert Ewayne's DSPMacro.asm to tasm ideal mode but something not what I expected. I wonder, why if statements giving error(in DSPRegs macro).


; DSPValue hWnd, ecx, 0, 't'
; t: Title, m: MessageBox
; 0: Unsigned 1: Signed
; ecx: eax, ebx, edx ...
; hWnd: Handle of app
ideal
MACRO DSPValue hWnd:req, value:req, sign:=<1>, loc:=<'m'>
LOCAL lbl
LOCAL LibName
LOCAL ProcName
LOCAL NoDllMsg
LOCAL NoDllMsgT
LOCAL NoDSPValue

pushad

dataseg

NoDllMsg db "Could't load the above DLL."
db 0dh,0ah
db 'You will need to place the DLL in the same Dir.'
db 0dh,0ah
db 'That your executing your program from.',0
NoDllMsgT db "Could't load the DSPVALUE.dll.",0
LibName db "DSPVALUE.dll",0
ProcName db "BaseAscii",0

codeseg
push loc
push sign
push value
push [hWnd]
call LoadLibrary, offset LibName
if (eax eq 0)
pop eax
pop eax
pop eax
pop eax
mov al, [loc]
if ((al == 'T') || (al == 't'))
call SetWindowText, [hWnd], offset NoDllMsgT
jmp NoDSPValue
endif
if ((al == 'S') || (al == 's'))
call SendMessage, [hWnd], SB_SETTEXT, 0, offset NoDllMsgT
jmp NoDSPValue
endif
call MessageBox, NULL, offset NoDllMsg, offset LibName, MB_OK or MB_ICONWARNING
jmp NoDSPValue
endif
call GetProcAddress, eax, offset ProcName
call eax
NoDSPValue:
popad
ENDM

;==================================================
MACRO DSPRegs hWnd
LOCAL NoDllMsg
LOCAL LibName
LOCAL ProcName
LOCAL hLib
LOCAL NoDSPValue

pushad

dataseg

NoDllMsg db "Could't load the above DLL."
db 0dh,0ah
db 'You will need to place the DLL in the same Dir.'
db 0dh,0ah
db 'That your executing your program from.',0
LibName db 'DSPVALUE.dll',0
ProcName db 'ShowRegs',0
hLib dd 0

codeseg
call LoadLibrary, offset LibName
mov [hLib], eax
popad
pushad
; mov eax, [hLib]
if(!hLib) ;;!eax
call MessageBox, NULL, offset NoDllMsg, offset LibName, MB_OK or MB_ICONWARNING
jmp NoDSPValue
endif
pushfd
push esp
push ebp
push edi
push esi
push edx
push ecx
push ebx
push eax
push [hWnd]
call GetProcAddress, [hLib], offset ProcName
call eax

NoDSPValue:
popad
ENDM
Posted on 2003-01-26 16:14:04 by cakmak
more clearly, I meant,


push value
push [hWnd]
call LoadLibrary, offset LibName
if (eax!=0) ;<- error: DSPValue(21) Need right parenthesis
pop eax


which parentheses? I couln't understood...

Thanks
Posted on 2003-01-27 08:59:20 by cakmak