I got stuck at this thing,I want to see if right shift button has been pressed,so I have this assambler code:
mov ah,2
int 16h ;calling INT 16,2 - Read Keyboard Flags interrupt
mov ah,10000000b
shl al,7
and al,10000000b
cmp al,ah ;check if first bit is 1
je rshift
jmp final
rshift:
mov ah,9
lea dx,rsh ;rsh is a string that says that "right shift button has been pressed"
int 21h
jmp final
final: ; quit program
mov ax,4c00h
int 21h
why is it not working ?,I think the problem is that int 16,2 is not working properly,if so why is that? here is what INT 16,2 is supposed to do:
AH = 02
on return:
AL = BIOS keyboard flags (located in BIOS Data Area 40:17)
|7|6|5|4|3|2|1|0| AL or BIOS Data Area 40:17
| | | | | | | `---- right shift key depressed
| | | | | | `----- left shift key depressed
| | | | | `------ CTRL key depressed
| | | | `------- ALT key depressed
| | | `-------- scroll-lock is active
| | `--------- num-lock is active
| `---------- caps-lock is active
`----------- insert is active
I never see the message,I ve looked at the AL register in debug and it doesn t seem to change after I call INT 16,2.I m running Win 7 on a x86 arhitecture,and I m working with tasm