home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / GLEN / VOL10N22.ZIP / CURDRI.ASM < prev    next >
Assembly Source File  |  1991-07-22  |  2KB  |  45 lines

  1. ;**********************************************************************
  2. ; CURDRI.ASM              Clipper .OBJ to get the current drive letter
  3. ; Author..: Sal Ricciardi
  4. ;
  5. ; Usage:  cdrive = curdrive()
  6. ;
  7. ; Create .OBJ with:   TASM curdri  (Borland Turbo Assembler 2.5)
  8. ;
  9. ; To link into your Clipper 5 app:
  10. ;   RTLINK FILE yourapp.obj, CURDRI.OBJ LIB CLIPPER, EXTEND
  11. ;
  12. ; To link into your Clipper Summer 87 app:
  13. ;   PLINK86 FILE yourapp.obj, CURDRI.OBJ LIB CLIPPER, EXTEND
  14. ;
  15. ;**********************************************************************
  16.               .MODEL LARGE
  17.               EXTRN  __retc:FAR
  18.               PUBLIC curdrive
  19.               .DATA
  20. cdrive        db    ?                           ;one byte for drive letter
  21.               .CODE
  22. curdrive      PROC  FAR                         ;entry point
  23.               push  ax                          ;save registers
  24.               push  bx                          ;
  25.               push  cx                          ;
  26.               push  dx                          ;
  27.               push  es                          ;
  28.               mov   ah,19h                      ;get current drive
  29.               int   21h                         ;dos interrupt
  30.               add   al,'A'                      ;convert number to letter
  31.               mov   cdrive,al                   ;store in cdrive
  32.               push  ds                          ;push FAR pointer to
  33.               mov   ax,OFFSET cdrive            ;cdrive
  34.               push  ax                          ;
  35.               call  __retc                      ;post Clipper return value
  36.               add   sp,4                        ;adjust the stack
  37.               pop   es                          ;restore registers
  38.               pop   dx                          ;
  39.               pop   cx                          ;
  40.               pop   bx                          ;
  41.               pop   ax                          ;
  42.               ret                               ;return to caller
  43. curdrive      ENDP
  44.               END
  45.