home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / memory / emstools / libsourc / emm26_c.asm < prev    next >
Encoding:
Assembly Source File  |  1989-11-29  |  4.5 KB  |  90 lines

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