Getting INT 16h key scancode instead of character
问题 I'm writing a simple bootloader, and I have a getch function. char getch() { uint16_t inchar; __asm__ __volatile__ ("int $0x16\n\t" : "=a"(inchar) : "0"(0x0)); return (char)inchar; } I tried the first obvious solution, which is remove the casting to char of the inchar variable, but when I print it still returning a char instead of code. My println implementation: void println(char *str) { while (*str) { // AH=0x0e, AL=char to print, BH=page, BL=fg color __asm__ __volatile__ ("int $0x10" : :