home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-1.ZIP / GCOMM / MACHINE.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-08-14  |  2.1 KB  |  75 lines

  1.         page    60,132
  2. ;
  3. ; The Greenleaf Comm Library
  4. ;
  5. ; Copyright (C) 1988-90 Greenleaf Software Inc.  All Rights Reserved.
  6. ;
  7.  
  8.         .xlist
  9.         include model.h
  10.         include prologue.h
  11.         .list
  12.  
  13.  
  14.         pseg    machine
  15.  
  16. ;**<<  M A C H I N E  >>**
  17. ;
  18. ;  unsigned machine()
  19. ;
  20. ;  Read and return the machine type byte at location ffff:e as documented
  21. ;  in the IBM Personal Computer AT Technical Reference manual.
  22. ;
  23. ;               Return Value            Machine type
  24. ;
  25. ;               0x00ff                  IBM Personal Computer
  26. ;               0x00fe                  IBM Personal Computer XT
  27. ;               0x00fd                  IBM PC/jr
  28. ;               0x00fc                  IBM Personal Computer AT
  29. ;                                       IBM PC-XT 286
  30. ;                                       IBM PS/2 model 50 & 60
  31. ;               0x00f9                  IBM PC Convertible
  32. ;               0x00fa                  IBM PS/2 model 30
  33. ;               0x00f8                  IBM PS/2 model 80
  34. ;
  35.         cproc   machine
  36.  
  37.         push    ds
  38.         push    bx
  39.         mov     bx,0ffffh
  40.         mov     ds,bx
  41.         mov     bx,0eh          ;ds:bx = ffff:e
  42.         mov     al,[bx]         ;get value to al
  43.         pop     bx
  44.         pop     ds
  45.         xor     ah,ah
  46.         cproce
  47.  
  48.  
  49. ;==>--  int     submodel(void)
  50. ;
  51. ;       Return the submodel I.D. of the system, return a (int)-1 if
  52. ;       Return system configuration parameters function of ROM BIOS is
  53. ;       not supported.
  54. ;
  55. ;               Return Value            Machine type
  56. ;               0xffff  (-1)            Return system config parameters
  57. ;                                       not supported.
  58. ;               0x04                    IBM PS/2 model 50 (if machine()=0xfc)
  59. ;               0x05                    IBM PS/2 model 60
  60. ;
  61.         cproc   submodel
  62.         push    es
  63.         mov     ah,0c0h
  64.         int     15h
  65.         mov     ax,-1
  66.         jc      subex
  67.         add     bx,3
  68.         mov     al,es:[bx]
  69.         xor     ah,ah
  70. subex:  pop     es
  71.         cproce
  72.  
  73.         endps
  74.         end
  75.