Caps lock
Posted: Mon Jul 28, 2008 5:04 pm
I am trying to get capslock to work but the code I have isnt recognizing that capslock is on. Does it look correct? I've only tested this in VirtualBox, could it just be the emulator?
The code is based off the falicy that if the value of al is greater than 64 then capslock is on (reference). I know that this can also be caused by insert but I'm just trying to get this thing to confim that its on. I will use bit masking later.
The code is based off the falicy that if the value of al is greater than 64 then capslock is on (reference). I know that this can also be caused by insert but I'm just trying to get this thing to confim that its on. I will use bit masking later.
Code: Select all
A005_capslock:
mov si,A005_strci
call print ;prints null terminated string in si
mov ah,02h
int 16h ;get shift flags
cmp al,40h ;if its greater than 40h either capslock is on or insert is
jl A005_off
mov si,A005_stron
call print
jmp A005_end
A005_off:
mov si,A005_stroff
call print
A005_end:
ret
A005_strci db "Caps Lock is ",0
A005_stron db "on",0Dh,0Ah,0
A005_stroff db "off",0Dh,0Ah,0