home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / MEMORY7.ASM < prev    next >
Assembly Source File  |  1994-12-01  |  1KB  |  51 lines

  1.     PAGE    66,132
  2. ;****************************** MEMORY7.ASM *********************************
  3. ;
  4. ;----------------------------------------------------------------------------
  5. LIBSEG           segment byte public "LIB"
  6.         assume cs:LIBSEG , ds:nothing
  7.  
  8. ;----------------------------------------------------------------------------
  9. .xlist
  10.     include  mac.inc
  11.     include  common.inc
  12.     extrn    cmos_type:far
  13.     extrn    cmos_read_word:far
  14. .list
  15. ;----------------------------------------------------------------------------
  16.  
  17. comment 
  18. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(  MEMORY )
  19. EXT_CHECK - check if EXT memory is present
  20. ; inputs:  none
  21. ; output:  ax = size of available extended memory in 1k blocks
  22. ;          bx = total amount of extended memory installed
  23. ;          
  24. ;* * * * * * * * * * * * * *
  25. 
  26.  
  27.     public    EXT_CHECK
  28. EXT_CHECK    proc    far
  29.     call    cmos_type
  30.     mov    ax,0            ;preload 0
  31.     cmp    dl,-1
  32.     je    ext2            ;jmp if cmos unknown type
  33.     mov    ah,30h            ;address of cmos ext_size variable
  34.     call    cmos_read_word
  35. ext2:    push    ax            ;save total ext memory size
  36.     clc                ;clear carry
  37.     mov    ah,88h            ;get extended memory size code
  38.     int    15h            ;call bios
  39.     jnc    cont_ext1        ;jump if we may    have extended memory
  40.     clc
  41.     jmp    ce_exit            ;jump if no extended installed
  42. cont_ext1:
  43.     pop    bx            ;get total ext size in 1k blocks
  44. ce_exit:
  45.     retf
  46. EXT_CHECK    endp
  47.  
  48.  
  49. LIBSEG    ENDS
  50. ;;    end
  51.