#include <stdio.h>
#define OPT //define for assembly
int main()
{
char chr;
for(chr = 'A' ; chr <= 'Z' ; chr++)
{
#ifdef OPT
__asm
{
lea eax,chr
push eax
mov eax, putchar
call eax
pop ebx
}
#endif
#ifndef OPT
putchar(chr);
#endif
}
return 0;
}
Upon usage of the assembly code, all that happens is a random trash-character is printed. Note this is in intel syntax.
Also: I'm learning inline assembly, how would you grab the return value of a called function (through mov eax,func then call eax or equiv?)
call putchar
? – TonyK