home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / fxn58h.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.5 KB  |  30 lines

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;          Function 58H: Get/Set Allocation Strategy         ;
  4.         ;                                                            ;
  5.         ;          int alloc_strategy(func,strategy)                 ;
  6.         ;              int func,strategy;                            ;
  7.         ;                                                            ;
  8.         ;          Strategies:                                       ;
  9.         ;                  0: First fit                              ;
  10.         ;                  1: Best fit                               ;
  11.         ;                  2: Last fit                               ;
  12.         ;                                                            ;
  13.         ;          Returns -1 for all errors, otherwise              ;
  14.         ;          returns the current strategy.                     ;
  15.         ;                                                            ;
  16.         ;************************************************************;
  17.  
  18. cProc   alloc_strategy,PUBLIC
  19. parmB   func
  20. parmW   strategy
  21. cBegin
  22.         mov     al,func         ; AL = get/set selector.
  23.         mov     bx,strategy     ; BX = new strategy (for AL = 01H).
  24.         mov     ah,58h          ; Set function code.
  25.         int     21h             ; Call MS-DOS.
  26.         jnb     no_err          ; Branch if no error.
  27.         mov     ax,-1           ; Return -1 for all errors.
  28. no_err:
  29. cEnd
  30.