NO

Author Topic: Simple PoASM example for newbies to get started  (Read 9781 times)

Freddy

  • Guest
Simple PoASM example for newbies to get started
« 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.

Grincheux

  • Guest
Re: Simple PoASM example for newbies to get started
« Reply #1 on: October 27, 2008, 02:48:45 PM »
How to create a project for an asm program ?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Simple PoASM example for newbies to get started
« Reply #2 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...)
/Pelle

Offline Vortex

  • Member
  • *
  • Posts: 865
    • http://www.vortex.masmcode.com
Re: Simple PoASM example for newbies to get started
« Reply #3 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.
Code it... That's all...