EUROASM DUMP=ON, DUMPALL=YES, DUMPWIDTH=32, \
LIST=ON, LISTVAR=YES, LISTMACRO=YES
t8219 PROGRAM FORMAT=COFF, WIDTH=32, LISTMAP=OFF, LISTGLOBALS=OFF
;;
Cube %MACRO Number ; Define macro which calculates the 3rd power of unsigned integer Number.
%IF "%Number" !== "EAX"
MOV EAX,%Number ; Skip this step when Number already is in EAX.
%ENDIF
MOV ECX,EAX ; Copy the input value N to register ECX.
MUL ECX ; Let EDX:EAX = Number*Number
JC $+4 ; CF=OF=1 when EDX is nonzero (32bit overflow). Skip the 2nd MUL.
MUL ECX ; Let EDX:EAX = Number*Number*Number
%ENDMACRO Cube; Returns EDX:EAX=Number3, ECX=Number, CF=OF=1 on overflow.
;;
Cube 5 ; Use the macro to compute 53.
ENDPROGRAM t8219