home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / doc / ems / disk3 / emm26_a.asm < prev    next >
Assembly Source File  |  1989-11-29  |  5KB  |  93 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM26_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_unalloc_raw_page_count                              ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the number of unallocated         ;
  7. ;                     non-standard length pages within expanded memory to the ;
  8. ;                     operating system.                                       ;
  9. ;                                                                             ;
  10. ;                     One variety of expanded memory board has a page size    ;
  11. ;                     which is a sub-multiple of 16K bytes.  An expanded      ;
  12. ;                     memory page which is a sub-multiple of 16K is termed a  ;
  13. ;                     raw page.  An operating system may deal with mappable   ;
  14. ;                     physical page sizes which are sub-multiples of 16K      ;
  15. ;                     bytes.                                                  ;
  16. ;                                                                             ;
  17. ;                     If the expanded memory board supplies pages in exact    ;
  18. ;                     multiples of 16K bytes, the number of pages this        ;
  19. ;                     function returns is identical to the number the         ;
  20. ;                     get_unalloc_page_count function returns.  In this case, ;
  21. ;                     there is no difference between a page and a raw page.   ;
  22. ;                                                                             ;
  23. ;           PASSED:   &unalloc_raw_pages:                                     ;
  24. ;                        is a far pointer to a count of the number of raw     ;
  25. ;                        pages that are currently available for use.          ;
  26. ;                                                                             ;
  27. ;         RETURNED:   status:                                                 ;
  28. ;                        is the status EMM returns from the call.  All other  ;
  29. ;                        returned results are valid only if the status        ;
  30. ;                        returned is zero.  Otherwise they are undefined.     ;
  31. ;                                                                             ;
  32. ;                     unalloc_raw_pages:                                      ;
  33. ;                        is a count of the number of raw pages that are       ;
  34. ;                        currently available for use.                         ;
  35. ;                                                                             ;
  36. ; C USE CONVENTION:   unsigned int status;                                    ;
  37. ;                     unsigned int unalloc_raw_pages;                         ;
  38. ;                                                                             ;
  39. ;                     status = get_unalloc_raw_page_count                     ;
  40. ;                                                     (&unalloc_raw_pages);   ;
  41. ;-----------------------------------------------------------------------------;
  42. .XLIST
  43. PAGE    60,132
  44.  
  45. IFDEF SMALL
  46.    .MODEL SMALL, C
  47. ENDIF
  48. IFDEF MEDIUM
  49.    .MODEL MEDIUM, C
  50. ENDIF
  51. IFDEF LARGE
  52.    .MODEL LARGE, C
  53. ENDIF
  54. IFDEF COMPACT
  55.    .MODEL COMPACT, C
  56. ENDIF
  57. IFDEF HUGE
  58.    .MODEL HUGE, C
  59. ENDIF
  60.  
  61. INCLUDE emmlib.equ
  62. INCLUDE emmlib.str
  63. INCLUDE emmlib.mac
  64. .LIST
  65. .CODE
  66.  
  67. get_unalloc_raw_page_count    PROC                                          \
  68.                 ptr_unalloc_raw_pages:FAR PTR WORD
  69.  
  70.     ;---------------------------------------------------------------------;
  71.     ;   do;                                                               ;
  72.     ;   .   get the number of unallocated RAW pages from EMM;             ;
  73.     ;---------------------------------------------------------------------;
  74.     MOVE        AX, get_unallocated_raw_pg_cnt_fcn
  75.     INT         EMM_int
  76.  
  77.     ;---------------------------------------------------------------------;
  78.     ;   .   pass the unallocated RAW page count back to the caller;       ;
  79.     ;---------------------------------------------------------------------;
  80.     MOVE        DX, BX
  81.     MOVE        ES:BX, ptr_unalloc_raw_pages
  82.     MOVE        ES:[BX], DX
  83.  
  84.     ;---------------------------------------------------------------------;
  85.     ;   .   return (EMM status);                                          ;
  86.     ;   end;                                                              ;
  87.     ;---------------------------------------------------------------------;
  88.     RET_EMM_STAT    AH
  89.  
  90. get_unalloc_raw_page_count    ENDP
  91.  
  92. END
  93.