home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ccdos / cchkos.asm < prev    next >
Assembly Source File  |  2020-01-01  |  1KB  |  51 lines

  1.  
  2.       include ccsdef.h
  3.  
  4.       public isccdos,chkos
  5.  
  6. datas segment para public 'datas'
  7.       isccdos   db   ?
  8. datas ends
  9.  
  10. code  segment para public 'code'
  11.       assume cs:code,ds:datas
  12.  
  13. ; chkos --- check which operating system is running, MS-DOS or CC-DOS. [zqf]
  14. ;       Return: 0 --- MS-DOS
  15. ;               1 --- CC-DOS
  16. ;       All registers are reserved.             June 19,1990 
  17. chkos proc  near
  18.       push      ax
  19.       push      bx
  20.       push      ds
  21.       push      es
  22.       mov  ax,datas
  23.       mov  ds,ax
  24.       mov  ax ,0000h
  25.       mov  es, ax
  26.  
  27.       mov  bx, 43h
  28.       mov  al, es:[bx]
  29.       cmp  al, 0a0h             ;check if Segment of vector of INT10H >=0Axxxh?
  30.       jae  next                 ; ae = Yes (non CCDOS)
  31.  
  32.       mov  bx, 5bh
  33.       mov  al, es:[bx]
  34.       cmp  al, 0a0h             ;check if Segment of vector of INT16H >=0Axxxh?
  35.       jae  next                 ; ae = Yes (non CCDOS)
  36.  
  37.       mov  isccdos ,01h         ; current state is CCDOS
  38.       jmp  next1
  39. next: 
  40.       mov  isccdos ,00h         ; current state is MSDOS
  41. next1:pop       es
  42.       pop       ds
  43.       pop       bx
  44.       pop       ax
  45.       ret
  46. chkos endp
  47.  
  48. code  ends
  49.       end  
  50.  
  51.