Assembly code snippets

Back to the snippets overview

Details

Titleincls
AuthorQvasiModo
Submitted by:QvasiModo
Date added:2003-06-26 02:35:36
Date modified:2003-07-23 19:18:23

Comments

This macro is meant for placing all your snippets in a single folder (\masm32\snippets).
The snippets files should end in ".inc" for the macro to work correctly.

Snippet

; incls MACRO
;   by QvasiModo

; This macro is meant for placing all your snippets in a single folder (masm32snippets).
; The snippets files should end in ".inc" for the macro to work correctly.

; Example:
;           incls Sample
; assembles:
;           include \masm32\snippets\Sample.inc

incls macro var:VARARG
    local count,countmax
    countmax = 0
    for arg, <var>
        countmax = countmax + 1
    endm
    if countmax eq 0
        exitm
    endif
    count = 1
:incls_loop
    incfile textequ @ArgI ( count, <var> )
    @CatStr ( <include \masm32\snippets\>, %incfile, <.inc> )
    if count eq countmax
        exitm
    endif
    count = count + 1
    goto incls_loop
endm