Here is a macro I like to use when I have to set one or more registers to zero.
Nothing spectacular, but useful to me, and helps make my code more readable to me. :bg
Clear MACRO args:VARARG
FOR p,<args>
xor p, p
ENDM
ENDM
Usage:
Clear EAX
or
Clear EAX, ECX, EDX
I hope this little macro is as useful to others as it is to me.
regards,
Rags
This is my most commonly used macro:
debug macro args:vararg
pushad
% print args
popad
endm
Actually, this one should really be included in the masm macros, I define it in every source file I have.
Usage note: if you use formatting macros like str$, ustr$, hex$, etc, surround them with <>. For example:
debug "Register eax: "
debug <ustr$(eax)>, 13, 10
This allows you to quickly set up debug points. I tracked down many bugs this way.