16h
中断并从这个代码开始
int main(){
char key, shiftKey(2);
asm ("movb %1, %%al;"
"int $0x16;"
"movb %%al, %0;"
:"=r"(key)
:"r"(shiftKey)
:"%al"
);
std::cout << int(key);
}
装配算法为:
-
将功能编号(02)传递给
al
登记
movb 2, al
-
int 16h
-
艾尔
此代码与
Process finished with exit code -1073741819 (0xC0000005)
. 所以我不知道我做错了什么。