Jwasm 2.12pre CreateDialogParam ebx,st(-1) (f48.9c0): Illegal instruction

Started by TouEnMasm, October 11, 2014, 01:17:40 AM

Previous topic - Next topic

TouEnMasm

Hello,
I have allready posted this one using other includes.
Try the edit menu --> "trouve" or "remplace" and you get
Quote
         ;mov     ebx,st(-1) (f48.9c0): Illegal instruction windbg      
         INVOKE     CreateDialogParam, Hmodule,addr strTrouve,hwnd, addr DlgFindReplace, 0
There is two CreateDialogParam in the edition.inc lines 292,312
Ml do not do that
Fa is a musical note to play with CL

qWord

MASM does use LEAVE in the epilogue, which does hide your actual problem. jWasm does pop EBP and thus requires ESP to be valid.
MREAL macros - when you need floating point arithmetic while assembling!

TouEnMasm

Fa is a musical note to play with CL

qWord

remove the line:
Code ("DlgFindReplace") Select
push     eax                      ; Save handle of edit1
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

Yep, line 88 in include.inc

These bugs are difficult to chase in ML.exe, in particular because your preserved regs look very different after the leave :badgrin:

@qWord: With the LOCAL, Jwasm behaves like ML. Without, it chokes. In any case, esi is trashed, of course.

include \masm32\include\masm32rt.inc

.code
MyTest proc uses esi arg1
LOCAL v1
  push arg1
  xor esi, esi ; preserved with uses
  mov v1, esi
  ret
MyTest endp

start:
mov esi, 123
invoke MyTest, 456
inkey str$(esi), " - should be 123"
exit

end start

TouEnMasm

Found

I have just modify the return values

DlgFindReplace PROC HdialBox:DWORD, wmsg, wparam, lparam
Local retour:DWORD
mov retour,TRUE
.if wmsg == WM_INITDIALOG              ; If message is INITDIALOG then
.elseif == ..
.else
        mov retour,FALSE
.endif

mov eax,retour
ret                             ; Return
DlgFindReplace  ENDP
;###################################################################
Fa is a musical note to play with CL