如何在x86程序集中循环MACRO

时间:2015-04-08 02:44:38

标签: assembly macros x86 masm

我有一个这样写的MACRO:

putspaces MACRO numspaces
    push ecx                ;pushes ecx reg onto stack for use
    mov ecx, numspaces      ;move the integer param numspaces into ecx for loop
spaceLoop:
    putc 32                 ;put space
    loop spaceLoop          ;continue looping until ecx = 0
    pop ecx                 ;release ecx register from the stack
    ENDM

我一直收到以下错误:

error A2005: symbol redefinition : spaceLoop

如何重写此宏以避免此错误,或循环以便我不重复使用标签?

0 个答案:

没有答案