我在8086 intel上使用x86 arquitecture。我想将密钥用户的罢工保存到变量中,以便稍后我可以使用该信息。我得到的问题是,我正在保存一些东西,但不是我正在抚摸的钥匙。我已经使用了键盘映射,这不是问题所在。这是我在键盘中断方法中编程的内容:
keyboard:
cli
in al,60h
cmp al,1Ch ;Enter
jne @f
mov [started],1
call paintScreenBlack
jmp final
@@: ;Procedure for saving the key
cmp al,128
ja final ;it checks if its a valid key
cmp [started],1
je final
xor ebx,ebx
mov bl,al
mov cl,[keymap+ebx] ;I save in cl the character according to the key
xor eax,eax
mov al,[word] ; Word is the variable where I want to save the information
mov bx,[cont] ; I check how many characters the user has striked
mov [eax+ebx],cl ;I save the character into the corresponding position
inc [cont] ; I count another character
call dibcar ;Then I do something else
final: mov al,20h ;end of hardware interruption
out 20h,al ; to master pic
sti
iret
我正在使用屏幕分辨率为50x80的文本模式