All pastes #708368 Raw Edit

blez

public text v1 · immutable
#708368 ·published 2007-09-23 19:50 UTC
rendered paste body
include 'hll.inc'

.$
    the beer source: example of hll macros used in fasm
    - multiline comments
    - var definition
    - hll functions including strings
    - new imports
    - smarter if, switch
    - assembly listing

    by blez
$.

type gui
enable listing

 ; gotta extern :|
 extern mciSendStringA:invoke
 extern opencd:call

 string sName = 'MyApplication'
 string sbuff[128]

 dword  result

 MessageBoxA(0,'Do you need additional place for the beer?',sName,MB_ICONQUESTION+MB_YESNO)


 mov [result], eax

 .if dword [result] = IDYES
     opencd()
 .else
     MessageBoxA(0,'Well ok then..',sName,MB_ICONINFORMATION+MB_OK)
 .endif

 ExitProcess(0)

proc opencd
     mciSendStringA('open cdaudio',0,0,0)
     mciSendStringA('set cdaudio door open',0,0,0)
     mciSendStringA('close cdaudio',0,0,0)
endp


imports
 libs kernel32,user32,winmm
 from kernel32,ExitProcess
 from user32,MessageBoxA,wsprintfA
 from winmm,mciSendStringA