Link to home
Start Free TrialLog in
Avatar of rj
rjFlag for Afghanistan

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

Avatar of rj
rj
Flag of Afghanistan image

ASKER

Edited text of question
Avatar of sandburd
sandburd

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:byte;
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 ----------
Avatar of rj

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

ASKER CERTIFIED SOLUTION
Avatar of sxh
sxh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rj

ASKER

Thanks for your answer!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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