rj
asked on
retrieve computer's BIOS date with Delphi Pascal
How can i retrieve the computer's BIOS date with Delphi Pascal (16 bits version)?
I tried memory location Mem[$FFFF:$0005] but this gives a general protection failure
I tried memory location Mem[$FFFF:$0005] but this gives a general protection failure
Hi,
With this little source i must work. The assembler routine gets the date. The other piece converts the date to a normal value, cause it's give in hexadecimal value's by the bios.
That's the default encoding that the bios uses for the value's, but there is a possibility that this is changed in the bios, the value's are given then binary. But i think that's not common.
I hope that this piece of code will help you.
Greetings,
Sandburd
------example code-------
var year,century,day,month:byt e;
begin
asm
mov ah,04h
int 1ah
mov year,cl
mov century,ch
mov day, dl
mov month, dh
end;
century:=(century div 16)*10 + century mod 16;
Year:= (Year div 16)*10 +Year mod 16;
day:=(day div 16)*10 +day mod 16;
month:=(month div 16)*10 +month mod 16;
--------example code ends ----------
With this little source i must work. The assembler routine gets the date. The other piece converts the date to a normal value, cause it's give in hexadecimal value's by the bios.
That's the default encoding that the bios uses for the value's, but there is a possibility that this is changed in the bios, the value's are given then binary. But i think that's not common.
I hope that this piece of code will help you.
Greetings,
Sandburd
------example code-------
var year,century,day,month:byt
begin
asm
mov ah,04h
int 1ah
mov year,cl
mov century,ch
mov day, dl
mov month, dh
end;
century:=(century div 16)*10 + century mod 16;
Year:= (Year div 16)*10 +Year mod 16;
day:=(day div 16)*10 +day mod 16;
month:=(month div 16)*10 +month mod 16;
--------example code ends ----------
ASKER
Thanks for our answer.
I copied your routine to my Delhi project.
Unfortunately it does not work. I know my computer's BIOS date is 12-19-96. Your assembler routine however returns the date of today.
I hope you have another solution.
Bye, Robbert-Jan
I copied your routine to my Delhi project.
Unfortunately it does not work. I know my computer's BIOS date is 12-19-96. Your assembler routine however returns the date of today.
I hope you have another solution.
Bye, Robbert-Jan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your answer!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hey guys you don't have an idea how the protected mode workz...
you can't access it directly....
There were in BC7 some constants (or variables) that contained
system addrs so i suppose in DELPHI there should be tha same...
Or try to look thru WIN SDK help for some functions doing this
you can't access it directly....
There were in BC7 some constants (or variables) that contained
system addrs so i suppose in DELPHI there should be tha same...
Or try to look thru WIN SDK help for some functions doing this
ASKER