Advertisement
Guest User

Check keyboard scancodes

a guest
May 4th, 2016
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BITS 16
  2.  
  3. jmp 7c0h: __START__
  4.  
  5. __START__:
  6.  
  7.   mov ax, cs
  8.   mov ss, ax
  9.   xor sp, sp
  10.   mov ds, ax
  11.  
  12.   push 0b800h
  13.   pop es
  14.   xor di, di
  15.   mov fs, di
  16.  
  17.   mov ax, 0003h
  18.   int 10h
  19.  
  20.   cli
  21.   mov ax, cs
  22.   shl eax, 10h
  23.   mov ax, isr09
  24.   mov DWORD [fs:09h*4], eax
  25.   sti
  26.  
  27. _done:
  28.   hlt
  29. jmp _done
  30.  
  31.  
  32.  
  33.  hex2s:
  34.   push bx
  35.   push ax
  36.  
  37.   mov bx, hex_digits
  38.   mov ah, 0ch
  39.  
  40.   push ax
  41.  
  42.   shr al, 04h
  43.   xlatb
  44.   stosw
  45.  
  46.   pop ax
  47.  
  48.   and al, 0fh
  49.   xlatb
  50.   stosw
  51.  
  52.   pop ax
  53.   pop bx
  54.  
  55.   ret
  56.  
  57.   hex_digits db "0123456789abcdef"
  58.  
  59.  
  60.  isr09:
  61.   in al, 60h
  62.   call hex2s
  63.  
  64.   mov al, 20h
  65.   out 20h, al
  66.  
  67.   iret
  68.  
  69.  TIMES 505-($-__START__) db 0
  70.  dw 0aa55h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement