view lib/alib/getfmd.a @ 2725:c2112f93923a lwtools-port

o dwio for Atari now uses routines in ROM, so dwread/dwrite stripped of Atari o Added NMI code (as a conditional) to clock
author Boisy Pitre <boisy.pitre@nuance.com>
date Tue, 31 Jul 2012 11:54:02 -0500
parents 7d70b7e1cb21
children aaba193af04f
line wrap: on
line source

************************************

* Get the "last modified" date of an open file

* NOTE: Even though OS9 does not save seconds in its
*       files this routine stores a zero in this position.
*       This is done to make the routine compatible with
*       DATESTR.

* OTHER MODULES NEEDED: none

* ENTRY: X=buffer for 6 byte date
*        A=path of open file

* EXIT: CC carry set if error
*       B  error code (if any) from SS.FD


 nam Get Last Modified Date
 ttl Assembler Library Module

 psect GETFMD,0,0,0,0,0

BUFSIZ equ 8

GETFMD:
 pshs x,y
 leas -BUFSIZ,s where to put FD sector info
 tfr s,x pointer for FD sector info
 ldy #BUFSIZ bytes to read from FD sector
 ldb #$0F SS.FD
 os9 I$GetStt
 bcs exit
 ldy BUFSIZ,s get back orig X
 ldx 3,s get 2 bytes
 stx ,y++ move year,month
 ldx 5,s
 stx ,y++ move date,hour
 lda 7,s
 sta ,y+ move minutes
 clr ,y null for seconds

exit
 leas BUFSIZ,s
 puls x,y,pc

 endsect