home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / DISK4.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  1KB  |  40 lines

  1.     page    66,132
  2. ;******************************** DISK4.ASM  *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. comment 
  13. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(  DISK   )
  14. FILE_FLUSH - flushes the DOS output buffer for specified handle
  15. ;
  16. ; inputs:    BX = file handle
  17. ;            flushing the buffer guards against data loss in case power
  18. ;            outages.
  19. ;            
  20. ; output:    if CF = 0, no error; function successful
  21. ;            if CF = 1, AX = DOS error code
  22. ;* * * * * * * * * * * * * *
  23. 
  24.     public    FILE_FLUSH
  25. FILE_FLUSH    PROC    FAR
  26.    PUSH    BX
  27.    MOV       AH,45h        ;duplicate file handle
  28.    INT     21h
  29.    JB      FF_EXIT
  30.    MOV     BX,AX
  31.    MOV       AH,3Eh        ;close file
  32.    INT     21h
  33. FF_EXIT:
  34.    POP     BX
  35.    RETF
  36. FILE_FLUSH    ENDP
  37.  
  38. LIBSEG    ENDS
  39.     end
  40.