Another way to do it (if I understood correctly what you want). Note the code doesn't do anything, it just echos the args during assembly.
@invalidcount is local to the macro, otherwise you could use the macro only once.
include \masm32\include\masm32rt.inc ; plain Masm32 for the fans of pure assembler
procR4 MACRO count, args:VARARG
Local ct, @invalidcount
mov eax,count
test eax,1
and eax,1 ;is count even ?
;which of the 2 is the fastest ?
;or would bt be faster ?
jnz @invalidcount
ct=1
FOR item, <args>
if ct and 1 ; odd?
echo First arg= [item]
else
echo Second arg=[item]
echo
endif
ct=ct+1
;I would like to use 2 of the arguments at a time here.
ENDM
@invalidcount:
ENDM
.code
start:
procR4 ecx, arg1A, arg1B, arg2A, arg2B, arg3A, arg3B
; procR4 ecx, arg1A, arg1B, arg2A, arg2B, arg3A, arg3B
exit
end start
This is what you see in the build output window:
***********
ASCII build
***********
First arg= [arg1A]
Second arg=[arg1B]
First arg= [arg2A]
Second arg=[arg2B]
First arg= [arg3A]
Second arg=[arg3B]
First arg= [arg1A]
Second arg=[arg1B]
First arg= [arg2A]
Second arg=[arg2B]
First arg= [arg3A]
Second arg=[arg3B]