Files
lba1-classic/LIB386/LIB_SYS/FILES_A.ASM
Gwen Gourevich c5f4f6ba25 Initial commit
2021-10-27 10:34:18 +02:00

111 lines
1.5 KiB
NASM
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;----------------------------------------------------------------------------
;' FILES_A.ASM 386
;' (c) Adeline 1994
;----------------------------------------------------------------------------
.386p
.model SMALL, SYSCALL
.data
.code
public NoLanguage Touch
extrn NoLanguage OpenRead:PROC
extrn NoLanguage Close:PROC
;----------------------------------------------------------------------------
Touch proc ,\
filename:DWORD
local handle:DWORD
local time:WORD
local date:WORD
mov [time], 0
mov [date], 0
;----------------------' Open
push filename
call OpenRead
add esp, 4
mov [handle], eax
;----------------------' Read Time and Date
mov ah, 2Ch
int 21h
xor ax, ax
mov al, dh
shr al, 1
mov byte ptr [time],al ;' Secondes / 2
xor ax, ax
mov al, cl
shl ax, 5
or [time], ax ;' Minutes
xor ax, ax
mov al, ch
shl ax, 11
or [time], ax ;' Heure
mov ah, 2Ah
int 21h
mov byte ptr [date],dl ;' Jour
xor ax, ax
mov al, dh
shl ax, 5
or [date], ax ;' Mois
xor ax, ax
sub cx, 1980
mov al, cl
shl ax, 9
or [date], ax ;' Anne
;----------------------' Change time and date for this file
mov ah, 57h
mov al, 1
mov bx, word ptr [handle]
mov cx, [time]
mov dx, [date]
int 21h
;----------------------' Close file
push [handle]
call Close
add esp, 4
ret
Touch endp
;----------------------------------------------------------------------------
; The
End