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

  1.     page    66,132
  2. ;******************************** DISK8.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_EXIST - determines if a file exists and can be opened
  15. ;
  16. ; inputs:    DS:[DX] pointing to ASCIIZ filename
  17. ; output:    if CF = 0, file exists
  18. ;            if CF = 1, AX = DOS error code
  19. ;* * * * * * * * * * * * * *
  20. 
  21.     public    FILE_EXIST
  22. FILE_EXIST    PROC    FAR
  23.    push    bx
  24.    mov       ax,3d00h        ;open file at ds:dx
  25.    INT     21h
  26.    JB      FEX_EXIT
  27.    MOV     BX,AX
  28.    MOV       AH,3Eh        ;close file
  29.    INT     21h
  30. FEX_EXIT:
  31.    POP     BX
  32.    RETF
  33. FILE_EXIST    ENDP
  34.  
  35. LIBSEG    ENDS
  36.     end
  37.