TITLE "DCKTDF - Dslib Ver 4.0" ;================================================================= ; Copyright (C) 1989 by Harold F. Bower. Permission granted to ; Alpha Systems Corp. to distribute with The Libraries, Version 4 ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from DSLIB3 routines by Bridger Mitchell ; Date : 27 Jun 87 ; Version : 1.0 ; Module : DGETTD ; Abstract: This module containd the routine GETTD which fills ; a User-specified 15-byte buffer with the Time and Date ; information for the indices provided by the user (pre- ; sumably from a call to FSTNXT). The 15 bytes consist of ; three fields for Create, Access and Modify date/time ; entries, with each entry corresponding to DateStamper ; layouts, except that no Seconds byte is included. ; Revision : ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points : PUBLIC GETTD ; External References : EXT OPENTD, CLOSTD, RWTD, @TDERR CSEG .Z80 ;=========================================================== ; Routine - GETTD. Get 15-byte T&D data on specified file ; Enter: A - T&D index (0..7) ; DE - T&D Sector ; HL - 15 byte user buffer ; Exit : F - Zero Flag Set (Z) if Error (No file/read err) ; Zero Clear (NZ) if OK ; Requirements: Desired drive must be logged in before call ; DMA address is altered by this routine ;=========================================================== GETTD: LD (TDINDX),A ; Save index into T&D sector LD (TDADDR),HL ; ..and dest addr for 15 bytes of time XOR A ; Set to READ mode PUSH DE ; Save Sector # around open CALL OPENTD ; Open !!!TIME&.DAT for Reading POP DE JR Z,TDERR ; ..jump to error if No Good XOR A ; Set read flag CALL RWTD ; ..and read the sector JR NZ,GETTD0 ; Continue if Good Read CALL CLOSTD ; Close the file for good form XOR A ; ..signify previous error JR TDERR ; Take Error exit ; Valid T&D sector is in the buffer, so extract desired record ; The sector starting addr is in HL GETTD0: LD A,(TDINDX) ; Calculate field offset ADD A,A ADD A,A ADD A,A ADD A,A LD E,A ; Entries are in 16-byte slots LD D,0 ADD HL,DE ; HL = Specific file Time data LD DE,(TDADDR) ; Get destination for time LD BC,15 ; ..which is 15 bytes long LDIR ; Move the data CALL CLOSTD ; Close !!!TIME&.DAT TDERR: JP Z,@TDERR ; Error if No good close XOR A ; ..else set good flags INC A RET ; Data Storage/Buffers DSEG ; Put this in Data Segment TDINDX: DEFS 1 ; Index to record in T&D sector TDADDR: DEFS 2 ; User's destination T&D field END