home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / assemutl.zip / PRTPATH.ASM < prev    next >
Assembly Source File  |  1984-01-19  |  871b  |  55 lines

  1. ;
  2. ; PRTPATH - This .COM file will print the current directory path.
  3. ;
  4. ; From PC-TECH Journal    Feb 1984. p. 22
  5. ; Author: Bruce Kvam.
  6.  
  7. dos    macro    function
  8.     mov    ah,function
  9.     int    21h
  10.     endm
  11.  
  12. putc    macro    char
  13.     mov    dl,char
  14.     dos    2
  15.     endm
  16.  
  17. code    segment
  18.  
  19.     assume    cs:code,ds:code,es:code
  20.     org 100h
  21. start:
  22.  
  23. ; Get and print the current drive
  24.  
  25.     dos    19h    ; Get default drive code form DOS.
  26.     add    al,'A'
  27.     putc    al    ; Display drive code.
  28.     putc    ':'
  29.     putc    '\'
  30.  
  31. ; Get and print current pathname
  32.  
  33.     mov    dl,0    ; Default drive from DOS.
  34.     lea    si,pathname
  35.     dos    47h
  36.  
  37. printloop:
  38.     cmp    byte ptr [si],0 ;pathname terminated by 0.
  39.     jz    exit
  40.     putc    [si]
  41.     inc    si    ; point to next character.
  42.     jmp    printloop
  43.  
  44. exit:
  45.     int    20h        ; Return to DOS.
  46.  
  47. ; Storage area where DOS writes the current pathname.  An ASCIIZ string.
  48.  
  49. pathname    db    65 dup (?)
  50.  
  51. code    ends
  52.     end    start
  53.  
  54.  
  55.