I have a program that was an example from our textbook, however when i put it in visual studio i get all kinds of errors. I am very new to Assembly, so I don't really know what this code is supposed to do, and i don't know why it is not working. Here is the code:
.model flat,c
.code
; extern "C" int CalcResult1_(int a, int b, int c);
CalcResult1_ proc
push ebp
mov ebp,esp
mov eax,[ebp+8]
mov ecx,[ebp+12]
mov edx,[ebp+16]
add eax,ecx
imul eax,edx
pop ebp
ret
CalcResult1_ endp
end
Here are the errors it gives:
1>------ Build started: Project: CompOrgHW2, Configuration: Debug Win32 ------ 1>assembly_.asm
1>g:\comporghw2\comporghw2\assembly_.asm(1): error C2059: syntax error: '.'
1>g:\comporghw2\comporghw2\assembly_.asm(2): error C2059: syntax error: '.'
1>g:\comporghw2\comporghw2\assembly_.asm(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>g:\comporghw2\comporghw2\assembly_.asm(7): error C2365: 'CalcResult1_': redefinition; previous definition was 'function'
1>g:\comporghw2\comporghw2\assembly_.asm(4): note: see declaration of 'CalcResult1_'
1>g:\comporghw2\comporghw2\assembly_.asm(7): error C2146: syntax error: missing ';' before identifier 'proc'
1>Done building project "CompOrgHW2.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========