Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.2 KiB

  1. ;/* himem1.asm
  2. ; *
  3. ; * Microsoft Confidential
  4. ; * Copyright (C) Microsoft Corporation 1988-1991
  5. ; * All Rights Reserved.
  6. ; *
  7. ; * Modification History
  8. ; *
  9. ; * Sudeepb 14-May-1991 Ported for NT XMS support
  10. ; */
  11. page 95,160
  12. title himem1 - A20 Handler stuff
  13. .xlist
  14. include himem.inc
  15. include xmssvc.inc
  16. .list
  17. public A20Handler
  18. extrn TopOfTextSeg:word
  19. extrn fA20Check:byte
  20. extrn A20State:byte
  21. assume cs:_text,ds:nothing
  22. ;*--------------------------------------------------------------------------*
  23. ;* *
  24. ;* A20 Handler Section: *
  25. ;* *
  26. ;* The Init code copies the proper A20 Handler in place. *
  27. ;* *
  28. ;* NOTE: the A20 handler may be called from the Int 15h hook which does *
  29. ;* not set ds = _text. DO NOT ASSUME DS == _TEXT! *
  30. ;* *
  31. ;*--------------------------------------------------------------------------*
  32. A20Handler:
  33. ;*----------------------------------------------------------------------*
  34. ;* *
  35. ;* TheA20Handler - Hardware Independent A20 handler for NT himem *
  36. ;* *
  37. ;* Enable/Disable the A20 line *
  38. ;* *
  39. ;* ARGS: AX = 0 for Disable, 1 for Enable, 2 for On/Off query *
  40. ;* RETS: AX = 1 for success, 0 otherwise *
  41. ;* if input AX=2 then Exit AX=0 means off and 1 means on *
  42. ;* REGS: AX and flags effected *
  43. ;* *
  44. ;*----------------------------------------------------------------------*
  45. TheA20Handler proc near
  46. cmp ax, 2
  47. jne @F
  48. mov al, cs:A20State
  49. cbw
  50. ret
  51. @@:
  52. XMSSVC XMS_A20
  53. ret
  54. TheA20Handler endp
  55. End_A20Handler:
  56. ; Sudeepb NOTE: DONOT ADD ANY THING after End_A20Handler and before InstallA20.
  57. ;*----------------------------------------------------------------------*
  58. ;* *
  59. ;* InstallA20 - *
  60. ;* *
  61. ;* Install the A20 Handler *
  62. ;* *
  63. ;* ARGS: None *
  64. ;* RETS: None *
  65. ;* REGS: *
  66. ;* *
  67. ;*----------------------------------------------------------------------*
  68. public InstallA20
  69. InstallA20 proc near
  70. mov fA20Check,1 ; A20 ON/OFF query supported
  71. mov [TopOfTextSeg],offset End_A20Handler
  72. clc
  73. ret
  74. InstallA20 endp
  75. _text ends
  76. end
  77.