Trying to implement an enum macro :
include enumMacro.inc
; enum macro by mabdelouahab
; https://masm32.com/board/index.php?msg=126825
enum MACRO __vargs:VARARG
LOCAL val__
val__=0
FOR __varg,<__vargs>
__varg EQU val__
val__ = val__ +1
ENDM
ENDM
.data
format db 'test1 = %u',13,10
db 'sample = %u',13,10
db 'experiment = %u',0
.data?
buffer db 64 dup(?)
.code
start:
enum test1,sample,experiment
invoke wsprintf,ADDR buffer,\
ADDR format,test1,sample,experiment
invoke StdOut,ADDR buffer
invoke ExitProcess,0
END start
Running the executable, I receive the following results :
test1 = 3
sample = 3
experiment = 3
The correct version should be :
test1 = 0
sample = 1
experiment = 2
Poasm does not correctly assign the parameters.