Answer the question
In order to leave comments, you need to log in
Why is function definition not found?
Hello, I'm writing my first masm calculator function that squares
a number.
//cpp-file
#include <iostream>
extern "C"
{
int square(int num);
}
int main()
{
int num;
std::cin >> num;
std::cout << square(num);
}
;masm32-file
.386
.model tiny, C
.code
square PROC
push ebp
mov ebp, esp
mov eax, DWORD PTR [ebp+8]
imul eax, DWORD PTR [ebp+8]
pop ebp
ret
square ENDP
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question