[fpc-pascal] converting a TP/BP library to FPC
Tomas Hajny
XHajT03 at hajny.biz
Thu Dec 6 09:13:15 CET 2012
On Thu, December 6, 2012 01:25, waldo kitty wrote:
>
> w2k with FPC 2.6.0 release using lazarus 1.1 only as an editor... no GUI
> stuffings at all... i'm using -Mtp in the project options...
>
> i have finally gotten around to trying to convert the old FTN/BBS MKSMG
> library
> to FPC... it was written for DOS TP/BP and has defines for windows which i
> assume is the early delphi... this is a first run at this and i'm only
The Windows part may be also TPW (Turbo Pascal for Windows) or the Windows
(MS Win 3.1) target in BP.
> working
> with a project file that contains all the units in the uses clause...
>
> currently i'm taking the "easiest way out" with "IFDEF FPC" to define
> within the
> "IFDEF WINDOWS" blocks using the DOS format for most things and using the
> FPC
> DOS unit... but i've run into something i don't know how to handle...
>
> 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...
I would recommend switching to Dos.GetMSCount for a cross-platform
solution. Note the following comment provided within the source:
{Offset between two return values corresponds to amount of milliseconds
between the two calls, however the exact value is not guaranteed to have
particular meaning - it can be e.g. amount of milliseconds since computer
startup on DOS-like x86 platforms, derived from Unix time on Unix etc.}
GetTickCount proposed in another response is WinXX specific (Win32/Win64
API call).
.
.
> PPS: sorry if this is rambling... today is my birthday and i'm also
> celebrating
> that, such as it is -=B-)
Happy birthday then! :-)
Tomas
More information about the fpc-pascal
mailing list