home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug002.arc / WIPE.ASM < prev    next >
Assembly Source File  |  1979-12-31  |  3KB  |  98 lines

  1. ; Title:  Wipe.asm (c)
  2. ;            Erase ALL (*.PRN, *.HEX, *.SYM, *.REL and *.BAK) on current drive
  3. ; Author: Steven D. Rudnik
  4. ; Date:   8/9/83
  5. ;               **********************
  6. ;                          * Copyright 1983 Sdr *
  7. ;               **********************
  8. ;
  9. ; *************************************************************************
  10. ; Notes:
  11. ;        If there are any users of ASM, MAC, CB80, or any other assemblers
  12. ;        or compilers, this program is for you.  Programmers who have only
  13. ;     limited disk storage space often find during development the need
  14. ;     to remove resultant files, i.e. BAK, SYM, etc..., from your disks
  15. ;     in order to make room for further development.    Why always type
  16. ;     those familiar ERA *.BAK, ERA *.PRN, etc...?    There is a saying
  17. ;     that reads:
  18. ;                    A good programmer does things only once, then has the
  19. ;                    computer do them, from then on...
  20. ;                                  SOUNDS REASONABLE!
  21. ; *************************************************************************
  22. ;
  23. ;    This software may be used in the PUBLIC DOMAIN for non-commercial
  24. ;    use only.  Any comments or suggestions may be referred to:
  25. ;
  26. ;            Steven D. Rudnik
  27. ;            201-993-2000  Ext. 4172  
  28. ;               (12:00 Noon to 4:30 PM EST)
  29. ;
  30. ; *************************************************************************
  31. ;
  32. ; Some equates...
  33. ;
  34. cpm         equ    0    ; cpm base
  35. bdos        equ    cpm+5    ; bdos entry point
  36. print        equ    09h    ; string out
  37. kill        equ    13h    ; delete file
  38. curdisk        equ    19h    ; return current disk
  39. setdma        equ    1ah    ; set DMA
  40. clsrn        equ    1ah    ; clearscreen
  41. cr        equ    0dh    ; return
  42. lf        equ    0ah    ; line feed
  43. endstr        equ    '$'    ; marker for string out
  44. ;
  45.     org    100h        ; let's start here...
  46. ;
  47. main:    mvi    c,curdisk    ; find which disk we're on
  48.     call    bdos
  49.     adi    41h        ; add 65 to make char
  50.     sta    disk        ; place char in output string
  51. ;
  52. erase:    mvi    c,print        ; print sign on message
  53.     lxi    d,signon    
  54.     call    bdos
  55. ;
  56.     lxi    h,table        ; load HL with table address
  57. loop:    mov    a,m        ; get char 1 of type 
  58.     inx    h        ; bump pointer...
  59.     sta    ext1        ; place char into output string
  60.     cpi    endstr        ; check for end of table...
  61.     jz    cpm        ; true =: done
  62.     mov    a,m        ; repeat for char 2...
  63.     inx    h
  64.     sta    ext2
  65.     mov    a,m        ; repeat for char 3...
  66.     inx    h
  67.     sta    ext3
  68. inloop:    mvi    c,kill        ; kill file(s) specified in fcb
  69.     lxi    d,fcb        ; our own FCB address
  70.     push    h        ; preserve because BDOS doth clobber...
  71.     call    bdos
  72.     pop    h        ; recall pointer...
  73.     cpi    0ffh        ; check return flag  0ffh := none found
  74.     jz    loop        ; if none found then wrap up
  75.     jmp    inloop
  76. ;
  77. ;       Modify table here, each entry must be three bytes (PRN, etc) and
  78. ;    end with 'endstr'.
  79. ;
  80. table:    db    'PRNBAKSYMRELHEXSYM'
  81.     db    endstr
  82. ;
  83. fcb:    db    0
  84.     db    '????????'
  85. ext1:    db    ' '
  86. ext2:    db    ' '
  87. ext3:    db    ' '
  88.     ds      21
  89. ;
  90. signon:    db    cr,lf
  91.     db    'Wipe  Version 1.0',cr,lf
  92.     db    '-----------------',cr,lf,lf
  93.     db    'Erasing *.PRN, *.HEX, *.SYM, *.REL and *.BAK from Drive '
  94. disk:    db    0
  95.     db    ':',cr,lf,endstr
  96. ;
  97. done:    end
  98.