home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / c128 / text / examples.arc / DEL.A < prev    next >
Encoding:
Text File  |  1989-12-01  |  2.4 KB  |  62 lines

  1. ; del.asm
  2. ;---------------------------------------------------------------------------
  3. ; Command:  del file file file ....
  4. ;---------------------------------------------------------------------------
  5. ; Old version of del
  6. ;
  7. ; Newer version (del.c) allows deleting wildcards like *.asm and is prefered
  8. ; over this one. This one uses normal CBM DOS wild cards, so del *.asm would
  9. ; really mean delete everything instead of just files that end in .asm
  10. ;
  11. ; This one is substantially smaller though and might be prefered for a RAM
  12. ; disk thats inside the C128
  13.  
  14.                                   
  15. pntr        = $00ec               ;cursor column
  16. int04       = $1704               ;get 1st char of parameter
  17. int05       = $1705               ;get next char of parameter
  18. int13       = $1713               ;delete file %x
  19. int0c       = $170c               ;read ds$
  20. int0d       = $170d               ;print ds$ after int0c
  21. int0e       = $170e               ;program terminate
  22. chrout      = $ffd2               
  23.                                   
  24. star        = $0b00               
  25.             .wor star             
  26.             * = star              
  27.  
  28.             jmp del
  29.             dw Date
  30.                       
  31. del         ldx #1                ;start with %1 and work up
  32.             stx parm              
  33.             jsr crdo              
  34. del0        ldx parm              ;echo filename to crt
  35.             jsr int04             
  36.             bcs delx              ;parameter wasn't there
  37. del1        jsr chrout            
  38.             jsr int05             
  39.             bcc del1              
  40. del2        jsr spc               ;tab(20)
  41.             lda pntr              
  42.             cmp #20               
  43.             bne del2              
  44.             ldx parm              
  45.             jsr int13             ;scratch it
  46.             jsr int0c             ;read ds$
  47.             jsr int0d             ;and print it
  48.             inc parm              
  49.             bne del0              ;next parameter
  50.                                   
  51. delx        jmp int0e             
  52.                                   
  53. spc         lda #" "              
  54.             .byt $2c              
  55. crdo        lda #13               
  56.             jmp chrout            
  57.                                   
  58. parm        = *                   
  59.                                   
  60.             .end                  
  61.                                   
  62.