home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
at
/
datefix.arc
/
DATEFIX.3TP
next >
Wrap
Text File
|
1987-12-01
|
1KB
|
59 lines
program datefix;
type
regpack = record
case integer of
1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : integer);
2: (AL,AH,BL,BH,CL,CH,DL,DH : byte);
end;
var
regs: regpack;
month,day,hour,minute,second : byte;
year :integer;
function dec(bcd:byte):byte;
var h,l : byte;
begin
h := trunc(bcd/16);
l := bcd-h*16;
dec := 10*h+l;
end;
begin
with regs do
begin
{read time from AT clock}
AH := $02;
intr($1A,regs);
hour := dec(CH);
minute := dec(CL);
second := dec(DH);
{read date from AT clock}
AH := $04;
intr($1A,regs);
day := dec(DL);
month := dec(DH);
year := dec(CL)+100*dec(CH);
{set DOS time}
AH := $2D;
CH := hour;
CL := minute;
DH := second;
DL := $00;
msdos(regs);
{set DOS date}
AH := $2B;
CX := year;
DH := month;
DL := day;
msdos(regs);
{ writeln (hour,':',minute,':',second);
writeln(month,'/',day,'/',year);
} end;
end.