title MSDOS 2.00 Function Library for Lattice C include mc.ash .model small .code ;; ;;FUNCTION: Get and set file times ;; ;; ;;CALL: ;; _ftime(1,handle,timedate) set time/date ;; _ftime(0,handle,timedate) get time/date ;; char timedate[4]; ;; int handle; ;; ;; ;;RETURN: ;; none ;; ;;DESCRIPTION: ;; ;; Get (0) or set (1) the time and date for ;; a handle. Returns the MSDOS format 4 ;; byte packed time and date. No validity ;; checks on anything, but the 0,1 flag is ;; masked. ;; ;; ;;CAUTIONS: Set file times must be done jus ;; before the file is closed. ;; ;;ASSUMPTIONS: ;; ;;LONG 32 bits (4 bytes) ;;INT 16 bits (2 bytes) ;;CHAR 8 bits (1 byte) ;; page func __ftime mov al,arg0 ;1=set, 0=get, and al,1 mov bx,arg1 ;file handle, if long lds si,dword ptr arg2 ;ptr to array else mov si,arg2 ;ptr to array, endif mov cx,[si] ;CX= time, mov dx,[si+2] ;DX= date, push si mov ah,87 int 33 pop si test byte ptr arg0,1 ;if get time, jnz _ft1 mov [si],cx ;return time, mov [si+2],dx ;return date, _ft1: endf __ftime end