; Ron Bardarson ZNC ( Znode Central 408-432-0821 ) ; TOUCH works with MAKE.RCP to reset the makebit. It's ; used where I used to use PROTECT. PROTECT wiped out all attribute ; bits, whereas TOUCH will only reset the makebit. Since the TUCH ; command inside MAKE.RCP handles single files, the purpose of ; TOUCH is to handle multiple files. ; M2 interface: ; TOUCH.Z80 is passed a ptr to a string ; it creates a parsed filename suitable for an FCB and transfers attributes ; TOUCH.Z80 returns a cardinal indicating: 0=pass ~0=fail bdos equ 5 ; anybody EVER use something different? chroff equ 4 ; filename offset to char with bit 7 set dw end-start ; size info for M2 start: jr rstart ; HL has (START) ds 40 ; FCB space db 'TOUCH' ; flag for debugging rstart: inc hl inc hl ; HL has FCB ptr push hl inc hl ; blank fill FCB ld bc,10 ld d,h ld e,l inc de ld (hl),20h ldir pop hl pop ix ; return address pop de ; string ptr ld bc,0 ; success oriented push bc ; returned parameter push ix ; prevent system crashes push hl ; save FCB ptr for other uses inc hl ; move away from drive ld b,8 name: ld a,(de) ; parse name and type into FCB cp 0 jr z,cont cp '.' jr z,type ld (hl),a inc hl inc de djnz name type: inc de ld c,b ld b,0 add hl,bc ld b,3 type1: ld a,(de) cp 0 jr z,cont ld (hl),a inc hl inc de djnz type1 cont: pop ix ; recover FCB ptr push ix ; still need it xor a ld (ix+0),a ; default drive ld (ix+12),a ; extent ; setup DMA for search function, and perform. pop hl ; guess push hl ; FCB not done with yet ld de,dma-start-2 add hl,de ; calculate DMA area ex de,hl ld c,1ah ; set DMA for search call bdos pop de push de ; a few more things to do with FCB ld c,11h ; search for first call bdos cp 0ffh jr nz,found ; Error, file not found. pop hl ; discard FCB ptr pop hl ; return address pop de ; returned value dec de ; error flag push de ; indicate failure jp (hl) found: pop hl ; get it back again push hl ; wonder if memory wears out?????? ld de,dma-start-2 add hl,de ; recalculate DMA location rrca ; 0->0, 1->32, 2->64, 3->96 rrca rrca ; *32 the size of disk FCB, carry set ld d,0 ld e,a add hl,de ; index to dir entry inc hl ; copy file's other attributes pop de push de ; will save FCB ptr forever..... inc de ld bc,11 ldir pop de ; last time for FCB ld hl,chroff ; high bit set => no change add hl,de res 7,(hl) ; touch file ld c,1eh ; set attribute jp bdos ; can't fail if search returned dma: ds 80h ; search DMA nop ; prevent SLRZ80 from chopping off end of file end: end