home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / doc / ems / disk2 / emm23_b.asm < prev    next >
Assembly Source File  |  1989-11-29  |  4KB  |  85 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM23_B.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_alter_map_call_stack_size                           ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the number of bytes of            ;
  7. ;                     information the alter_map_call function pushes onto the ;
  8. ;                     stack each time it is invoked.                          ;
  9. ;                                                                             ;
  10. ;           PASSED:   &call_stack_space_size:                                 ;
  11. ;                        is a far pointer to the number of bytes which the    ;
  12. ;                        alter_map_call function will require.                ;
  13. ;                                                                             ;
  14. ;         RETURNED:   status:                                                 ;
  15. ;                        is the status EMM returns from the call.  All other  ;
  16. ;                        returned results are valid only if the status        ;
  17. ;                        returned is zero.  Otherwise they are undefined.     ;
  18. ;                                                                             ;
  19. ;                     call_stack_space_size:                                  ;
  20. ;                        is the number of bytes which the alter_map_call      ;
  21. ;                        function will require.  In other words, it is the    ;
  22. ;                        number (including the return address) which has to   ;
  23. ;                        be added to the stack pointer to remove all elements ;
  24. ;                        from the stack.                                      ;
  25. ;                                                                             ;
  26. ; C USE CONVENTION:   unsigned int status;                                    ;
  27. ;                     unsigned int call_stack_space_size;                     ;
  28. ;                                                                             ;
  29. ;                     status = get_alter_map_call_stack_size                  ;
  30. ;                                                      (&call_stack_space);   ;
  31. ;-----------------------------------------------------------------------------;
  32. .XLIST
  33. PAGE    60,132
  34.  
  35. IFDEF SMALL
  36.    .MODEL SMALL, C
  37. ENDIF
  38. IFDEF MEDIUM
  39.    .MODEL MEDIUM, C
  40. ENDIF
  41. IFDEF LARGE
  42.    .MODEL LARGE, C
  43. ENDIF
  44. IFDEF COMPACT
  45.    .MODEL COMPACT, C
  46. ENDIF
  47. IFDEF HUGE
  48.    .MODEL HUGE, C
  49. ENDIF
  50.  
  51. INCLUDE emmlib.equ
  52. INCLUDE emmlib.str
  53. INCLUDE emmlib.mac
  54. .LIST
  55. .CODE
  56.  
  57. get_alter_map_call_stack_size    PROC                                          \
  58.                 ptr_stack_space_count:FAR PTR WORD
  59.  
  60.     ;---------------------------------------------------------------------;
  61.     ;   do;                                                               ;
  62.     ;   .   get the amount of stack space allocated by the alter_map_call ;
  63.     ;   .   function during its execution;                                ;
  64.     ;---------------------------------------------------------------------;
  65.     MOVE        AX, get_page_map_stack_space_size_fcn
  66.     INT         EMM_int
  67.  
  68.     ;---------------------------------------------------------------------;
  69.     ;   .   pass the count of the stack space allocated by the            ;
  70.     ;   .   alter_map_call back to the caller;                            ;
  71.     ;---------------------------------------------------------------------;
  72.     MOVE        DX, BX
  73.     MOVE        ES:BX, ptr_stack_space_count
  74.     MOVE        ES:[BX], DX
  75.  
  76.     ;---------------------------------------------------------------------;
  77.     ;   .   return (EMM status);                                          ;
  78.     ;   end;                                                              ;
  79.     ;---------------------------------------------------------------------;
  80.     RET_EMM_STAT    AH
  81.  
  82. get_alter_map_call_stack_size    ENDP
  83.  
  84. END
  85.