How to use labels in Nasm macros

Viewed 1345

I am experimenting in Nasm assembly out of pure interest. I was wondering how I would go about using labels in a macro function. I have tried my code below and this gives me redefining label errors, I already thought you probably wouldn't be able to redefine labels but I am unsure of how to proceed.

%macro ut_time 1
    mov  eax, 13
    push eax
    mov  ebx, esp
    int  80h
    pop  ecx
elapsedTimeLoop:
    mov  eax, 13
    push eax
    mov  ebx, esp
    int  80h
    pop  ecx
    sub  edx, ecx
    cmp  edx, %1
    je   end
    jmp  elapsedTimeLoop
end:

%endmacro

If you would like me to provide the above segment in a error-reproducing program this can be done.

0 Answers
Related