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

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;                Function 56H: Rename File                   ;
  4.         ;                                                            ;
  5.         ;                int rename(poldpath,pnewpath)               ;
  6.         ;                    char *poldpath,*pnewpath;               ;
  7.         ;                                                            ;
  8.         ;                Returns 0 if file moved OK,                 ;
  9.         ;                otherwise returns error code.               ;
  10.         ;                                                            ;
  11.         ;************************************************************;
  12.  
  13. cProc   rename,PUBLIC,<ds,di>
  14. parmDP  poldpath
  15. parmDP  pnewpath
  16. cBegin
  17.         loadDP  es,di,pnewpath  ; ES:DI = pointer to newpath.
  18.         loadDP  ds,dx,poldpath  ; DS:DX = pointer to oldpath.
  19.         mov     ah,56h          ; Set function code.
  20.         int     21h             ; Ask MS-DOS to rename file.
  21.         jb      rn_err          ; Branch on error.
  22.         xor     ax,ax           ; Return 0 if no error.
  23. rn_err:
  24. cEnd
  25.