home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / memory / emslib / emsclsa.asm < prev    next >
Encoding:
Assembly Source File  |  1988-04-25  |  1.1 KB  |  41 lines

  1.  
  2. emm_int   equ      67h
  3.  
  4.           if1
  5.           INCLUDE  model.mac
  6.           endif
  7.  
  8. header
  9.  
  10. begdataseg
  11.           EXTRN    _emserr     :byte
  12.           EXTRN    _EMSAvPgs   :word
  13. enddataseg
  14.  
  15. begcodeseg
  16.           EXTRN    _emspgsowned :NEAR
  17. procstart __emsclose
  18.           push     bp
  19.           mov      bp,sp
  20.           mov      dx,WORD PTR [bp+4]      ; move handle into dx
  21.           push     dx
  22.           call     _emspgsowned
  23.           add      sp,2
  24.           cmp      _emserr,0               ; check for error
  25.           jnz      error
  26.           mov      ax,_EMSAvPgs            ; update EMSAvPgs
  27.           add      ax,bx                   ; bx contains the number of pages -
  28.           mov      _EMSAvPgs,ax            ; owned by the handle
  29.           mov      dx,WORD PTR [bp+4]      ; move handle into dx
  30.           mov      ah,45h
  31.           int      emm_int                 ; call EMM
  32. error:    mov      al,ah                   ; move ah down to
  33.           xor      ah,ah                   ; al
  34.           mov      _emserr,al              ; update emserr
  35.           pop      bp
  36.           ret
  37. procend   __emsclose
  38. endcodeseg
  39.           END
  40.  
  41.