Guest User

Untitled

a guest
Jun 24th, 2017
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdint.h>
  2. #include <stddef.h>
  3. #include "system.h"
  4.  
  5. int32_t kmain(void) {
  6.  
  7. clear_screen();
  8.  
  9. install_gdt();
  10. install_idt();
  11.  
  12. puts("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\nNEWLINE\n");
  13.  
  14.  
  15. // TEST CASE 1: works (exception 0)
  16.  
  17. // __asm__("xor %eax, %eax");
  18. // __asm__("div %eax, %eax");
  19.  
  20. // TEST CASE 2: works (exception 3)
  21.  
  22. // __asm__("int $3");
  23.  
  24. // TEST CASE 3: doesn't work?? (should be exception 0, but it is exception 6 which is Invalid Opcode)
  25.  
  26. putc('A' / 0);
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment