home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / SYSTEM / A20TEST.ZIP / QUERYA20.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-01-18  |  2.4 KB  |  89 lines

  1.                 page    60, 132
  2.                 title   Gate A20 status utility
  3.  
  4.  
  5. ;************************************************************************
  6. ;*
  7. ;*      Check to see if line A20 is enabled or disabled.  This routine
  8. ;*   is hardware dependent and will only work properly on AT's and 100%
  9. ;*   compatibles.
  10. ;*
  11. ;************************************************************************
  12.  
  13.                 ORG     100h
  14. CODE            segment public 'CODE'
  15.                 assume cs:CODE, ds:CODE, es:CODE
  16.  
  17. Start:          jmp     QueryA20
  18.  
  19. A20OnMessage    db      13, 10, 'The A20 line is currently ENABLED.', 13, 10, '$'
  20. A20OffMessage   db      13, 10, 'The A20 line is currently DISABLED.', 13, 10, '$'
  21.  
  22. QueryA20:       mov     ax, cs
  23.                 add     ax, 0010h
  24.                 mov     ds, ax
  25.                 mov     es, ax
  26.                 call    IsA20On
  27.                 or      ax, ax
  28.                 jz      A20Off
  29.  
  30. A20On:          mov     dx, offset A20OnMessage
  31.                 jmp     short QueryDone
  32.  
  33. A20Off:         mov     dx, offset A20OffMessage
  34.  
  35. QueryDone:      mov     ah, 09h
  36.                 int     21h
  37.  
  38.                 mov     ax, 4C00h
  39.                 int     21h
  40.  
  41.  
  42. ;************************************************************************
  43. ;*
  44. ;*      Check line A20 status.
  45. ;*
  46. ;*      Proc    : IsA20On
  47. ;*      Params  : None
  48. ;*      Return  : AX = 1                --> A20 enabled
  49. ;*                AX = 0                --> A20 disabled
  50. ;*      Regs    : AX, CX, DI, SI & flags clobbered.
  51. ;*      Notes   :
  52. ;*
  53. ;************************************************************************
  54.  
  55. LowMemory       label   dword
  56.                 dw      00080h
  57.                 dw      00000h
  58.  
  59. HighMemory      label   dword
  60.                 dw      00090h
  61.                 dw      0FFFFh
  62.  
  63. IsA20On         proc    near
  64.  
  65.                 push    ds
  66.                 push    es
  67.  
  68.                 lds     si, es:LowMemory
  69.                 les     di, es:HighMemory
  70.                 mov     cx, 4
  71.                 cld
  72.                 repe    cmpsw
  73.  
  74.                 pop     es
  75.                 pop     ds
  76.                 xor     ax, ax
  77.  
  78.                 jcxz    IAONoWrap
  79.                 inc     ax
  80.  
  81. IAONoWrap:      xor     bl, bl
  82.                 ret
  83.  
  84. IsA20On         endp
  85.  
  86.  
  87. CODE            ends
  88.                 end     Start
  89.