Reset, Backup dan Restore CMOS
Program Reset;
var
i:byte;
begin
writeln('Reset CMOS');for i:=1 to 255 do
begin
port[$70]:=i;
port[$71]:=0;
end;
writeln('Reset CMOS sukses');
end.
=====================================================
Program Backup;
var
i:byte;
buffer : array[1..255] of byte;
f : file;
nm : string;
begin
writeln('Backup CMOS');
for i:=1 to 255 do
begin
port[$70]:=i;
buffer[i]:=port[$71];
end;
write('Masukkan nama file backup : ');readln(nm);
assign(f,nm);
{$I-}Rewrite(f,1);{$I+}
if IOResult <> 0 then
begin
writeln('Gagal membuat backup');
halt(1);
end;
blockwrite(f,buffer,sizeof(buffer));
close(f);
writeln('Backup CMOS sukses');
end.
=====================================================
Program Restore;
var
i:byte;
buffer : array[1..255] of byte;
f : file;
nm : string;
begin
writeln('Restore CMOS');
write('Masukkan nama file backup : ');readln(nm); assign(f,nm);
{$I-}Reset(f,1);{$I+}
if IOResult <> 0 then
begin
writeln('Gagal membuka backup');
halt(1);
end;
blockread(f,buffer,sizeof(buffer)); for i:=1 to 255 do
begin
port[$70]:=i;
port[$71]:=buffer[i];
end;
close(f);
writeln('Restore CMOS sukses');
end.
Selamat Mencoba.
Tidak ada komentar:
Posting Komentar