Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. ; irq.s
  2.  
  3. ; The IRQ and ISR code must be setup in Assembly before it can be used in C
  4. ; because the C compiler doesn't understand that the registers and stack are
  5. ; required to be preserved between the asm statements and it will corrupt the stack.
  6. global kb_isr
  7. global idt_load
  8.  
  9. ; Keyboard ISR handler
  10. extern kb_isr_handler
  11.  
  12. ; idt_load is defined in irq.s and loads the IDT.
  13. idt_load:
  14. mov edx, [esp + 4]
  15. lidt [edx]
  16. sti
  17. ret
  18.  
  19. kb_isr:
  20. pushad
  21. cld
  22. call kb_isr_handler
  23. popad
  24. iretd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement