The MASM Forum

Projects => Easy Code IDE 32/64-bit => Topic started by: PaulIshak on July 29, 2012, 05:23:09 AM

Title: New To Masm - EasyCode.... Can someone help me out with a hello world sample?
Post by: PaulIshak on July 29, 2012, 05:23:09 AM
 Can someone help me out with a hello world sample? :icon_mrgreen:
Title: Re: New To Masm - EasyCode.... Can someone help me out with a hello world sample?
Post by: qWord on July 29, 2012, 05:52:59 AM
include \masm32\include\masm32rt.inc
.code
main proc
    print "abc",13,10
    exit
main endp
end main
Title: Re: New To Masm - EasyCode.... Can someone help me out with a hello world sample?
Post by: PaulIshak on July 29, 2012, 06:12:47 AM
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
Title: Re: New To Masm - EasyCode.... Can someone help me out with a hello world sample?
Post by: rsala on July 29, 2012, 07:33:43 AM
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

Title: Re: New To Masm - EasyCode.... Can someone help me out with a hello world sample?
Post by: PaulIshak on July 29, 2012, 10:14:52 AM
Awesome! :t  Thank you rsala!
Title: Re: New To Masm - EasyCode.... Can someone help me out with a hello world sample?
Post by: PaulIshak on July 29, 2012, 10:24:27 AM
Whats going on with each line of code?