Hi,
I´m using MASM32 (version7 I think) to compile this "simple" code:
;set 32 Bit "flat" memory model:
.386
.model flat
;windows.inc for MASM needs the following option set:
IFDEF masm
option casemap :none
ENDIF
;constants and structures for the
;WinAPI core functions (TASM/MASM-Syntax):
include WINDOWS.inc
;include external (windows) functions:
IFDEF masm
MessageBoxA equ _MessageBoxA@16
ExitProcess equ _ExitProcess@4
ENDIF
extrn ExitProcess : near
extrn MessageBoxA : near
;put the data here:
.data
MessageBoxJustatitle db "Unbelievable, but reality",0
MessageBoxUselessContent db "Great message, isn`t it ?",0
ErrorCode dd 0
;and the code there:
.code
;execution starts here
_letsbegin:
;masses of code, this MessageBox, for example
push MB_ICONHAND or MB_OKCANCEL
push offset MessageBoxJustatitle
push offset MessageBoxUselessContent
;One could pass the window handle here,
;but windows are introduced in the next tutorial:
push 0
call MessageBoxA
;return value: in EAX resides a value
;indicating which button was clicked on
;thats enuf today: lets get outta here
push ErrorCode
call ExitProcess
;astalavista, baby...
;define the entry point:
end _letsbegin
However I got a lot of error messages like these:
c:\<file>\windows.inc(35) : error A2119: language type must be specified
(have a lot of these.......................)
c:\<file>\windows.inc(8746) : error A2008: syntax error: in structure
(a lot of these too)
c:\<file>\windows.inc(8758) : error A20008: structure improperly initialize
(a lot of these too)
What is happen? So much erros to a simple piece of code?
I can´t even compile my first "hello world" program in assembly? lol
Need help!
Thank you
Sérgio Oliveira
I´m using MASM32 (version7 I think) to compile this "simple" code:
;set 32 Bit "flat" memory model:
.386
.model flat
;windows.inc for MASM needs the following option set:
IFDEF masm
option casemap :none
ENDIF
;constants and structures for the
;WinAPI core functions (TASM/MASM-Syntax):
include WINDOWS.inc
;include external (windows) functions:
IFDEF masm
MessageBoxA equ _MessageBoxA@16
ExitProcess equ _ExitProcess@4
ENDIF
extrn ExitProcess : near
extrn MessageBoxA : near
;put the data here:
.data
MessageBoxJustatitle db "Unbelievable, but reality",0
MessageBoxUselessContent db "Great message, isn`t it ?",0
ErrorCode dd 0
;and the code there:
.code
;execution starts here
_letsbegin:
;masses of code, this MessageBox, for example
push MB_ICONHAND or MB_OKCANCEL
push offset MessageBoxJustatitle
push offset MessageBoxUselessContent
;One could pass the window handle here,
;but windows are introduced in the next tutorial:
push 0
call MessageBoxA
;return value: in EAX resides a value
;indicating which button was clicked on
;thats enuf today: lets get outta here
push ErrorCode
call ExitProcess
;astalavista, baby...
;define the entry point:
end _letsbegin
However I got a lot of error messages like these:
c:\<file>\windows.inc(35) : error A2119: language type must be specified
(have a lot of these.......................)
c:\<file>\windows.inc(8746) : error A2008: syntax error: in structure
(a lot of these too)
c:\<file>\windows.inc(8758) : error A20008: structure improperly initialize
(a lot of these too)
What is happen? So much erros to a simple piece of code?
I can´t even compile my first "hello world" program in assembly? lol
Need help!
Thank you
Sérgio Oliveira