$invoke MACRO Fun:REQ, A:VARARG
  IFB <A>
    invoke Fun
  ELSE
    invoke Fun, A
  ENDIF
  EXITM <eax>
        ENDM       


GetRValue MACRO arg:REQ
    mov eax, arg
    and eax, 0ffh
endm <eax>

GetGValue MACRO arg:REQ
    mov eax, arg
    shr eax, 8
    and eax, 0ffh
endm <eax>

GetBValue MACRO arg:REQ
    mov eax, arg
    shr eax, 16
endm <eax>

$RGB MACRO red:req,green:req,blue:req
    EXITM %(((blue) SHL 16) OR ((green) SHL 8) OR (red))
ENDM

    ;; -----------------------------------
    ;; INPUT red, green & blue BYTE values
    ;; OUTPUT DWORD COLORREF value in eax
    ;; -----------------------------------
      RGB MACRO red, green, blue
        xor eax, eax
        mov al, blue    ; blue
        rol eax, 8
        mov al, green   ; green
        rol eax, 8
        mov al, red     ; red
      ENDM
      
      RGBQ MACRO red, green, blue
        xor eax, eax        
        mov al, red     ; red
        rol eax, 8       
        mov al, green   ; green
        rol eax, 8
        mov al, blue    ; blue
      ENDM      

MsgBox  macro   txt
    pusha
    invoke  MessageBox,NULL,txt,SZ("Infos..."),MB_ICONINFORMATION + MB_APPLMODAL
    popa
endm
 
MAKEDWORD MACRO LoWord,HiWord
    mov ax, HiWord
    ror eax, 16
    mov ax, LoWord
ENDM 
     
LOWORD macro bigword    ; Возврвщает младщее слово  
   mov  eax,bigword
   and  eax,0FFFFh     ;; Set to low word 
endm


HIWORD macro bigword    ; Возврвщает старшее слово 
   mov  eax,bigword
   shr  eax,16         ;; Get high word
endm

	mov1 macro a, b
		mov eax, b
		mov a, eax
	endm

	xora macro
		xor eax, eax
	endm

	xorb macro
		xor ebx, ebx
	endm

	xord macro
		xor edx, edx
	endm