home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR8 / TCD11.ZIP / DIRCHNG.ASM next >
Assembly Source File  |  1993-05-25  |  751b  |  26 lines

  1. ;
  2. ; integer cd(string s)
  3. ;
  4. ; cd('..' + Chr(0))
  5. ;
  6. ; long PASCAL cd(uchar *far string);
  7. ;
  8. ;                       bp+06 seg string
  9. ;                       bp+04 ofs string
  10. ;                       bp+02 seg ret
  11. ;                       bp+00 ofs ret
  12. ;
  13. cd proc
  14.         mov     bp,sp
  15.         lds     dx,[bp+4]               ; ofs string
  16.         inc     dx                      ; move past the length
  17.         inc     dx                      ;    word
  18.         mov     ah,3bh                  ; change dir
  19.         int     21h                     ; dos call
  20.         mov     ax, 0                   ; assume error...
  21.         jc      @@exit
  22.         inc     ax                      ; single success
  23. @@exit:
  24.         cwd
  25.         retf
  26. cd endp