DoMath MACRO num:REQ
LOCAL cnt
cnt = 0
WHILE cnt < num
cnt = cnt + 1
.code
add ecx,4
sub edx,4
ENDM
ENDM
can't get this to work, tryed just DoMath 5 in hopes it'll generate add ecx,4 and sub edx,5, 5 times in a row, i'm code speed testing and don't feel like typing same stuff over and over. any hints?
error says missing angle bracket or brace or literal
hi,
in macros you have to use other comparison operators: EQ,LE,GE,NE,GT,LT
--> WHILE cnt LT num
thanks qword, I managed to get workin with
cnt = num
WHILE cnt
cnt = cnt -1
but it's good to know the comparisons, I looked at macros.asm in masm's folder and didn't see what I was lookin for.
If the value of cnt will not be encoded into an instruction, why not just use something like:
REPEAT num
add ecx, 4
sub edx, 4
ENDM