; Library: ZSLIB ; Version: 1.0 ; Module: ZSGSSTP ; Version: 1.0 ; Author: Carson Wilson ; Date: December 29, 1988 ; Changes: Uses DOSTYP function instead of TESTZS (discontinued). ; Version: 0.1 ; Author: Carson Wilson ; Date: August 22, 1988 ; ; Purpose: Get and Set file datestamp. ; PUBLIC GETSTP,SETSTP EXTRN DOSTYP BDOSPTR equ 5 SETDMA equ 26 GETDMA equ 47 GETFSTP equ 102 SETFSTP equ 103 ; ; GETSTP - Get file datestamp to 128-byte buffer ; ; Entry: - points to file's FCB. ; - points to 128-byte datestamp buffer. ; Note: if file is not at default drive, FCB must be ; initialized with drive. If file is not at default user, ; FCB must be initialized with user number and ZSDOS ; error mode set to non-zero. ; Exit: - Zero flag set (Z) and A=0 if buffer filled, ; Zero flag reset (NZ) if error. ; Uses: - . ; GETSTP: push bc push de push hl ld a,GETFSTP jr GETSET ; ; SETSTP - Set file datestamp from 128-byte buffer ; ; Entry: - points to file's FCB. ; - points to 128-byte datestamp buffer. ; Note: if file is not at default drive, FCB must be ; initialized with drive. If file is not at default user, ; FCB must be initialized with user number and ZSDOS ; error mode set to non-zero. ; Exit: - Zero flag set (Z) and A=0 if file stamped, ; Zero flag reset (NZ) if error. ; Uses: - ; SETSTP: push bc push de push hl ld a,SETFSTP GETSET: ld (FUNCT),a ; Save get/set ; 1. Test for ZSDOS call DOSTYP ; Test if ZSDOS cp 'S' jr z,GTSET1 cp 'D' jr nz,EXIT ; No, return error GTSET1: ; 2. Set DMA to user's buffer. ld c,GETDMA ; Preserve entry DMA call BDOSPTR ld (DMAORIG),hl pop de push de ; DE --> user's buffer ld c,SETDMA call BDOSPTR ; 3. Copy user's FCB to temp. and initialize for Get/Set pop de pop hl ; HL --> user's FCB push hl ; push de ld de,TMPFCB push de ; Save ld bc,14 ; d+name+ext+s1 ldir ; Copy to temp. ex de,hl ld (hl),b ; Module 0 dec hl dec hl ld (hl),b ; Extent 0 ; 4. Get or Set file stamp to/from user's buffer pop de ; DE --> tmpfcb ld a,(FUNCT) ld c,a ; Get or set stamp call BDOSPTR ; ..to/from user's buffer ; 5. Restore entry DMA address and return push af ; Save return code ld de,(DMAORIG) ld c,SETDMA call BDOSPTR ; Restore entry DMA pop af dec a ; 1 --> 0 means get/set ok EXIT: pop hl pop de pop bc ret ; ----------------- ; Data area DSEG FUNCT: ds 1 ; Get or set DMAORIG: ds 2 ; Entry DMA TMPFCB: ds 36 ; Temp. FCB end ; End ZSGSSTP.Z80