Author Topic: Jwasm 2.12pre CreateDialogParam ebx,st(-1) (f48.9c0): Illegal instruction  (Read 2039 times)

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
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

  • Member
  • *****
  • Posts: 1454
  • The base type of a type is the type itself
    • SmplMath macros
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!

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm

Did you see something to do ?.
Fa is a musical note to play with CL

qWord

  • Member
  • *****
  • Posts: 1454
  • The base type of a type is the type itself
    • SmplMath macros
remove the line:
Code: ("DlgFindReplace") [Select]
push     eax                      ; Save handle of edit1
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

  • Member
  • *****
  • Posts: 7548
  • Assembler is fun ;-)
    • MasmBasic
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.

Code: [Select]
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
« Last Edit: October 11, 2014, 05:25:30 AM by jj2007 »

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Found

I have just modify the return values
Code: [Select]
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