I'm doing homework and trying to read keys from keyboard. I tried to use 16h interrupt and started with this code
int main(){
char key, shiftKey(2);
asm ("movb %1, %%al;"
"int $0x16;"
"movb %%al, %0;"
:"=r"(key)
:"r"(shiftKey)
:"%al"
);
std::cout << int(key);
}
Assembly algorithm is:
al register movb 2, alint 16hal now should have mask of all keys like shift, capslock etc.This code crashes with Process finished with exit code -1073741819 (0xC0000005). So I have no proper info what have I done wrong.
User contributions licensed under CC BY-SA 3.0