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

  1. myfcb   db      0               ; drive = default
  2.         db      'MYFILE  '      ; filename, 8 chars
  3.         db      'DAT'           ; extension, 3 chars
  4.         db      25 dup (0)      ; remainder of FCB
  5.         .
  6.         .
  7.         .
  8.         mov     dx,seg myfcb    ; DS:DX = FCB
  9.         mov     ds,dx
  10.         mov     dx,offset myfcb
  11.         mov     ah,0fh          ; function 0FH = Open FCB
  12.  
  13.         int     21h             ; transfer to MS-DOS
  14.         or      al,al           ; test status
  15.         jz      success         ; jump, open succeeded
  16.                                 ; open failed, get
  17.                                 ; extended error info
  18.         mov     bx,0            ; BX = 00H for ver. 2.x-3.x
  19.         mov     ah,59h          ; function 59H = Get Info
  20.         int     21h             ; transfer to MS-DOS
  21.         or      ax,ax           ; really an error?
  22.         jz      success         ; no error, jump
  23.                                 ; test recommended actions
  24.         cmp     bl,01h
  25.         jz      retry           ; if BL = 01H retry operation
  26.         cmp     bl,04h
  27.         jz      cleanup         ; if BL = 04H clean up and exit
  28.         cmp     bl,05h
  29.         jz      panic           ; if BL = 05H exit immediately
  30.         .
  31.         .
  32.         .
  33.