I'm trying to use the assembly inline code in C with gcc, to use the interrupt 21 with ah = 07h to make a getchar without echo. This is my code(the main):
...
int main(int argc, char *argv[])
{
int t, x, y;
char input;
asm(
"movb $0x01, %%ah\n\t"
"int $0x21\n\t"
"movb %%al, %0"
: "=r" (input)
);
printf("Character: %c\n", input);
return 0;
}
...
But it doesn't work, it compiles successfully but it doesn't do anything.