First off, you don't need to clear eax, ebx, or ecx - your function always overwrites what is there so it's irrelevant what they contain on entry.
Secondly, your assembly code is within a function body, so the assembler label LOC_FUN just marks a point in the assembler code, not a "new function" start in the C sense.
You need to jump over the function to your actual call - because otherwise the
ret
is encountered without a call, and the app crashes or exits, providing no printout.
Additionally, Assembler labels aren't case sensitive: so having yours called MAIN may confuse things with the C code main function.
Try this:
#include <stdio.h>
int main()
{
int a = 4, b = 2, c = 1;
__asm
{
jp START
LOC_FUN:
mov eax, 6
mov ebx, 21
mov ecx, 32
ret
START :
call LOC_FUN
mov a, eax
mov b, ebx
mov c, ecx
};
printf("%d\n", a);
printf("%d\n", b);
printf("%d\n", c);
return 0;
}