News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

New To Masm - EasyCode.... Can someone help me out with a hello world sample?

Started by PaulIshak, July 29, 2012, 05:23:09 AM

Previous topic - Next topic

PaulIshak

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

qWord

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

Thanks ;) How can I show hello world inside a message box when the button is clicked?
.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

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