; ; WIPE+.ASM version 1.2 ; -- erases all .$$$, .BAK, .HEX, .PRN, .REL, and .SYM files ; -- this version runs properly only on CP/M Plus (3.0). To ; run under CP/M 2.2 set CPM3 equate to false and reassemble ; with MAC (Z80.LIB required). ; ; USAGE: ; ; WIPE {d:} ; ; If no drive specification is given, the current drive is assumed. ; ; ; HISTORY: ; ; Version 1.0, August 9, 1983, Steven D. Rudnik ; Original code. ; Version 1.1, March 1, 1985, Ron Forsythe ; Removed .HEX file erasing and added a long, silly ; signon. ; Version 1.2, May 11, 1987, Gene Pizzetta ; Added drive specification for command line, simplified ; signon, tidied-up code. CP/M Plus specific code added. ; ; Copyright 1983, Steve D. Rudnik. This software may be used in the ; PUBLIC DOMAIN for non-commercial purposes only. ; ; True equ 0FFFFh False equ Not True WStart equ 00h Bdos equ 05h PrtStr equ 09h Erase equ 13h CurDisk equ 19h CpmFcb equ 5Ch Delim equ 6Eh NoFile equ 0FFh CR equ 0dh LF equ 0ah CPM3 equ True ; MACLIB Z80 org 100h ; jmp MAIN db ' WIPE+ 1.2 ' ; MAIN: lda CpmFcb ; check default FCB cpi 0 ; is it the default drive? cz DEFAULT ; if so, find out what it is sta DISK ; put the drive spec into FCB adi 64 ; make it printable sta MSGDSK ; stuff into message IF CPM3 mvi c,Delim ; set new PrtStr delimiter lxi d,0 ; ..as null call Bdos ; CP/M PLUS FUNCTION ENDIF mvi c,PrtStr ; print signon message lxi d,SIGNON call Bdos ; ; Now erase files ... ; lxi h,TABLE ; load HL with table address LOOP: mov a,m ; get char 1 of filetype inx h ; bump pointer... sta EXT1 ; place char into output string cpi 0 ; check for end of table... jz WStart ; if so, we're done mov a,m ; repeat for char 2... inx h sta EXT2 mov a,m ; repeat for char 3... inx h sta EXT3 INLOOP: mvi c,Erase ; erase files specified in FCB lxi d,FCB ; FCB address push h ; preserve because BDOS clobbers call Bdos pop h cpi NoFile ; check return flag JRZ LOOP ; if none found then wrap up jmp INLOOP ; DEFAULT: mvi c,CurDisk ; get current disk call Bdos adi 1 ; make it acceptable to FCB ret ; ; ******************************************************* ; Modify filetype table here: ; Each entry must be three bytes. ; The table string must end with NULL (0). ; TABLE: db '$$$BAKHEXPRNRELSYM' db 0 ; ******************************************************* ; FCB: DISK: db 0 ; target drive FNAME: db '????????' ; wildcard filename EXT1: db ' ' ; filetype .. EXT2: db ' ' ; ..a character EXT3: db ' ' ; ..at a time ; zero out rest of FCB db 0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0 ; SIGNON: db 'Wiping ' IF CPM3 db '.$$$, ' ENDIF db '.BAK, .HEX, .PRN, .REL, and .SYM files from drive ' MSGDSK: db 0 db ':',CR,LF IF CPM3 db 0 ELSE db '$' ENDIF ; end