Author Topic: New To Masm - EasyCode.... Can someone help me out with a hello world sample?  (Read 4916 times)

PaulIshak

  • Guest
 Can someone help me out with a hello world sample? :icon_mrgreen:

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Code: [Select]
include \masm32\include\masm32rt.inc
.code
main proc
    print "abc",13,10
    exit
main endp
end main
MREAL macros - when you need floating point arithmetic while assembling!

PaulIshak

  • Guest
Thanks ;) How can I show hello world inside a message box when the button is clicked?
Code: [Select]
.Const

.Data?

.Data

.Code

Window1Procedure Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
.If uMsg == WM_CREATE

.ElseIf uMsg == WM_COMMAND

.ElseIf uMsg == WM_CLOSE
Invoke IsModal, hWnd
.If Eax
Invoke EndModal, hWnd, IDCANCEL
Mov Eax, TRUE ;Return TRUE
Ret
.EndIf
.EndIf
Xor Eax, Eax ;Return FALSE
Ret
Window1Procedure EndP

Window1Button1 Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
Xor Eax, Eax ;Return FALSE
Ret
Window1Button1 EndP

rsala

  • Moderator
  • Member
  • *****
  • Posts: 296
    • Easy Code
Hi PaulIshak,

Thanks fo using Easy Code!

Here is the code you asked for:

.Const

.Data?

.Data

.Code

Window1Procedure Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
   .If uMsg == WM_CREATE

   .ElseIf uMsg == WM_COMMAND
      LoWord wParam
      .If Ax == IDC_WINDOW1_BUTTON1
         HiWord wParam
         .If Ax == BN_CLICKED
            Invoke MessageBox, hWnd, TextAddr("Hello world!"), TextAddr("Title"), MB_OK
            Return TRUE
         .EndIf
      .EndIf
   .ElseIf uMsg == WM_CLOSE
      Invoke IsModal, hWnd
      .If Eax
         Invoke EndModal, hWnd, IDCANCEL
         Mov Eax, TRUE ;Return TRUE
         Ret
      .EndIf
   .EndIf
   Xor Eax, Eax   ;Return FALSE
   Ret
Window1Procedure EndP


Note that the procedure for Button1 (Window1Button1 Proc ...) has been removed as it is not needed.

Please read the help file for visual projects.

Regards,

Ramon

EC coder

PaulIshak

  • Guest
Awesome! :t  Thank you rsala!

PaulIshak

  • Guest
Whats going on with each line of code?