; POASM Example
; Written by Freddy
; Assemble with PoASM. Written in Pelles C IDE.
; EQUATES - Get them by right clicking the names at Pelles C editor and clicking at "Go to definition of", then translate to ASM. ;D
; No need for include files with a great IDE like Pelles C.
MB_OK EQU 0h
MB_YESNO EQU 4h
IDYES EQU 6h
MessageBox EQU MessageBoxA
;
.386
.model flat, stdcall
;
; Prototypes - See MSDN for more info. The nice thing is that most are DWORD args.
MessageBoxA proto :DWORD, :DWORD, :DWORD, :DWORD
ExitProcess proto : DWORD
; Data section
.data
strttl db 'Testing', 0
strmsg db 'Do you like PoASM?', 0
stryes db 'Yes, PoASM is cool!', 0
;Code section
.code
; Entry point
main:
invoke MessageBox,0, OFFSET strmsg, OFFSET strttl, MB_YESNO ; Testing invoke macro to call MessageBox API
.If EAX == IDYES ; Testing .If macro :)
invoke MessageBox, 0, OFFSET stryes, OFFSET strttl, MB_OK
.EndIf ; Works great!
invoke ExitProcess,0 ; Exit the program
end main
; EOF
Enjoy! This example shows that it's easy to create stand-alone programs with PoASM too.