I'm having a really confusing problem with my keyboard driver. When I execute the code shown below on real hardware, cl is always 1 (although that memory location is 0 as I have proven by reading its contents in other places), however on both Bochs and Qemu it comes out as 0 (which is as expected).
Code: Select all
keyboard.movewindow:
push ax
push ebx
push cx
push ds
push ax
mov ax, #0x0010
mov ds, ax
pop ax
mov ebx, #279
seg ds
mov cl, [ebx]
inc ebx
seg ds
mov ch, [ebx]
inc ebx
seg ds
mov ah, [ebx]
cmp ah, #0
jz keyboard.skipmovewindow
mov bh, al
and bh, #0x03
sub bh, #2
mov bl, al
and bl, #0x0C
ror bl, #2
sub bl, #2
push bx
int 0x6A
mov al, #2
cmp ch, #1
jz keyboard.getwindowscroll
cmp cl, #1
jz keyboard.getwindowsize
int 0xAC
jmp keyboard.valuesfetched
keyboard.getwindowscroll:
int 0xAD
jmp keyboard.valuesfetched
keyboard.getwindowsize:
int 0xAB
keyboard.valuesfetched:
pop ax
add bh, ah
add bl, al
int 0x6A
mov al, #1
cmp ch, #1
jz keyboard.setwindowscroll
cmp cl, #1
jz keyboard.setwindowsize
int 0xAC
jmp keyboard.valuesset
keyboard.setwindowscroll:
int 0xAD
jmp keyboard.valuesset
keyboard.setwindowsize:
int 0xAB
keyboard.valuesset:
keyboard.skipmovewindow:
pop ds
pop cx
pop ebx
pop ax
ret
Thanks,
onlyonemac