Pelles C forum

Assembly language => Assembly discussions => Topic started by: Freddy on February 13, 2008, 09:50:19 PM

Title: Simple PoASM example for newbies to get started
Post by: Freddy on February 13, 2008, 09:50:19 PM
Code: [Select]
; 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.
Title: Re: Simple PoASM example for newbies to get started
Post by: Grincheux on October 27, 2008, 02:48:45 PM
How to create a project for an asm program ?
Title: Re: Simple PoASM example for newbies to get started
Post by: Pelle on October 30, 2008, 04:31:17 PM
No default wizard for asm projects, just create an empty project (of the appropriate type) and add one or more asm files...

(The project wizard API can be used to make custom wizards for asm projects too - this has been done in the past...)
Title: Re: Simple PoASM example for newbies to get started
Post by: Vortex on November 28, 2008, 05:07:38 PM
How to create a project for an asm program ?

Attached is a simple asm project created with Pelles IDE.