Advertisement
jazz_vico

orga 2 practica ej 11

Nov 13th, 2018
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. offset:dd 0
  2. selector: dw 0
  3.  
  4. .dame_tecla_presionada:
  5.     pushad
  6.     xor eax,eax  
  7.     in al, 0x60 ; in lee un dispositivo. Aca guardamos el scan code en al
  8.     call fin_intr_pic1
  9.     push al
  10.     call add_key_to_buffer    
  11.     cmp [task_wait_key] null
  12.     jne .reestablecer
  13.     .fin:  
  14.     popad
  15.     iret
  16.     .reestablecer:
  17.         call task_wait_key
  18.         push eax
  19.         add_to_sheduler    
  20.         jmp .fin
  21.  
  22.  
  23. ._isr90:
  24.     sub esp, 4
  25.     push esp
  26.     call get_key_from_buffer
  27.     add esp, 4
  28.     cmp eax 1
  29.     je .hay_tecla
  30.     jne .no_hay_tecla
  31.    
  32.     .fin:
  33.         iret;
  34.  
  35.     .hay_tecla:    
  36.         call scancose_a_ascii ;esto me devuelve en al el ascii del scan code guardado en esp. asumo q esto libera el buffer    
  37.         jmp .fin
  38.  
  39.     .no_hay_tecla:
  40.         call sched_tareaActual 
  41.         mov ebx eax
  42.         mov [task_wait_key] ebx ;ebx= id tarea actual
  43.         push ebx
  44.         call remove_from_scheduler
  45.         call next_task()
  46.         mov [selector], ax
  47.         jmp far [offset]
  48.         jmp .si_hay_tecla
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement