News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

.IF .ELSIF .ELSE .ENDIF

Started by GUAN DE DIO, July 26, 2008, 12:12:07 AM

Previous topic - Next topic

GUAN DE DIO

Hi everybody,

        I'm making  several program test and I found that the .IF .ELSE .ENDIF macros don't work  properly.

        Has anybody the implementation of new macros to work on 64 bits?
       
       Maybe somebody has a link to know how to implement it ?

Thanks in advance,

GUAN

MazeGen

Emulating these constructs using macros is not easy. I remember that someone posted macros which simulates these directives some months ago on this board, try to search it.

GUAN DE DIO

The unique macros that I found here it is within the file x64calling.inc where we have the macros: INOVOKE, "LOCAL", ... the new way of declaration  functions to use with the new macros but nothing about .IF, .BREAK.WHILE, ...

GUAN


GUAN DE DIO

Thanks MazeGen,

    I was waiting for a solution like as MASM32 but this solution is good too, now my code is readable xD


GUAN

function WndProc,hWin:QWORD,uMsg:DWORD,wParam:QWORD,lParam:QWORD

   xor rax,rax
   mov eax,uMsg
   
   @IF <<cmp eax,WM_INITDIALOG>>, EQUAL?
   
      push   hWin
      pop   hWnd
      
   @ELSEIF <<cmp eax,WM_COMMAND>>,EQUAL?
   
      mov      rax,wParam
      @IF <<cmp ax,IDM_FILE_EXIT>>,EQUAL?
         invoke SendMessage,hWin,WM_CLOSE,0,0
         
      @ELSEIF <<cmp ax,IDM_HELP_ABOUT>>,EQUAL?      
      
         invoke ShellAbout,hWin,addr AppName,addr AboutMsg,NULL
         
      @ENDIF
   @ELSEIF <<cmp eax,WM_CLOSE>>,EQUAL?
   
      invoke DestroyWindow,hWin
      
   @ELSEIF <<cmp eax,WM_DESTROY>>,EQUAL?
      invoke PostQuitMessage,NULL
   
   @ELSE
      invoke DefWindowProc,hWin,uMsg,wParam,lParam
      return rax
   @ENDIF   
   
   return FALSE

endf
ret