[fpc-pascal] converting a TP/BP library to FPC

Chad Berchek ad100 at vobarian.com
Thu Dec 6 05:53:04 CET 2012


Perhaps it would be sufficient to supply the time value from another 
source converted to the units the other code is expecting to see. 
Assuming the frequency for the BIOS timer is about 18.2 Hz:

function TimeCounter: LongInt;
begin
   Result := LongInt(Round(GetTickCount * 18.2065 / 1000));
end;

wherein GetTickCount is a function returning a value in milliseconds. 
However you'd have to be careful of the overflow wrap around and see if 
the old code can handle it.

On 12/5/2012 6:25 PM, waldo kitty wrote:
>
> Var
>    TimeCounter: LongInt Absolute $40:$6C;
>
> FPC tells me the following...
>
> MKDOS.PAS(14,36) Fatal: Syntax error, ";" expected but ":" found
>
> i know this is using direct access to the timer ticker from the BIOS but
> at this time, i don't know how to best handle it in FPC...




More information about the fpc-pascal mailing list