PS2SCANCODES.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Contains three tables for PS/2 scan codes
  3. * Each table is 256 words long to account for all possible scan code
  4. * One for shifted, one for non-shifted
  5. * and one for extended
  6. */
  7. void DATA_PS2SCANCODE_NORMAL(){
  8. asm(
  9. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 9 96 0\n"
  10. ".dw 0 0 0 0 0 113 49 0 0 0 122 115 97 119 50 0\n"
  11. ".dw 0 99 120 100 101 52 51 0 0 32 118 102 116 114 53 0\n"
  12. ".dw 0 110 98 104 103 121 54 0 0 44 109 106 117 55 56 0\n"
  13. ".dw 0 44 107 105 111 48 57 0 0 46 47 108 59 112 45 0\n"
  14. ".dw 0 0 39 0 91 61 0 0 0 0 10 93 0 92 0 0\n"
  15. ".dw 0 60 0 0 0 0 8 0 0 49 0 52 55 0 0 0\n"
  16. ".dw 48 46 50 53 54 56 27 0 0 43 51 45 42 57 0\n"
  17. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  18. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  19. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  20. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  21. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  22. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  23. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  24. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  25. );
  26. }
  27. void DATA_PS2SCANCODE_SHIFTED(){
  28. asm(
  29. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 9 126 0\n"
  30. ".dw 0 0 0 0 0 81 33 0 0 0 90 83 65 87 64 0\n"
  31. ".dw 0 67 88 68 69 36 35 0 0 32 86 70 84 82 37 0\n"
  32. ".dw 0 78 66 72 71 89 94 0 0 59 77 74 85 38 42 0\n"
  33. ".dw 0 60 75 73 79 41 40 0 0 62 63 76 58 80 95 0\n"
  34. ".dw 0 0 34 0 123 43 0 0 0 0 10 125 0 124 0 0\n"
  35. ".dw 0 62 0 0 0 0 8 0 0 49 0 52 55 0 0 0\n"
  36. ".dw 48 46 50 53 54 56 27 0 0 43 51 45 42 57 0\n"
  37. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  38. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  39. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  40. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  41. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  42. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  43. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  44. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  45. );
  46. }
  47. /* vritual codes:
  48. - left 256
  49. - right 257
  50. - up 258
  51. - down 259
  52. - insert 260
  53. - home 261
  54. - pageup 262
  55. - end 263
  56. - pagedown 264
  57. */
  58. void DATA_PS2SCANCODE_EXTENDED(){
  59. asm(
  60. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  61. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  62. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  63. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  64. ".dw 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0\n"
  65. ".dw 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0\n"
  66. ".dw 0 0 0 0 0 0 0 0 0 263 0 256 261 0 0 0\n"
  67. ".dw 260 127 259 0 257 258 0 0 0 0 264 0 0 262 0 0\n"
  68. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  69. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  70. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  71. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  72. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  73. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  74. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  75. ".dw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
  76. );
  77. }