Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
If it is "inline assembler", the procedure must be formatted according to C syntax.
int Calculate(int x, int n) { __asm { mov eax, x mov ecx, n mov ebx, 0 for: push eax imul eax, ecx imul eax, 2 add ebx, eax pop eax loop for mov eax, ebx } } void main() { int s = Calculate(2, 2); cout << "Result=" << s; }
PROC, ENDP and other keywords are not available in this mode. In a separate asm file inside the project, using the "Microsoft Macro Assembler" build rule, this will compile.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question