Recent

Author Topic: FPC doesn't compile TPInline module (from Turbo Professional lib. by TurboPower)  (Read 405 times)

Megabyte

  • Newbie
  • Posts: 2
Hello. I encounter a problem. Free Pascal doesn't compile TPInline module (from Turbo Professional library by TurboPower Software).

(https://funkyimg.com/p/38joH.png) (https://funkyimg.com/p/38joG.png)

However, when it compiled by native Turbo Pascal, everything goes fine.

(https://funkyimg.com/p/38joE.png)

Can you help me with my problem? I really need this module in Free Pascal.

Thanks in advance!

Original file from library:

Bart

  • Hero Member
  • *****
  • Posts: 4045
    • Bart en Mariska's Webstek
You know that this inline is 8086 code?
It'll only run on plain DOS.
What do you need it for?

(IIRC then fpc doesn't support this style of inline. The asm code is right next to it, so you could make it asm in Pascal.)

Bart

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8902
  • FPC developer.
Do you use the 16-bit compiler?

Megabyte

  • Newbie
  • Posts: 2

PascalDragon

  • Hero Member
  • *****
  • Posts: 2433
  • Compiler Developer
Can you help me with my problem? I really need this module in Free Pascal.

FPC does not support TP's Inline intrinsic. You need to convert it to full blown inline assembly.

Essentially you should be able to simply take the comments at the right and copy that into asmend blocks in the implementation section for each function and add the directives assembler; nostackframe; to the declarations in the interface section.

Please note however that these routines are only useful if you use FPC's i8086-msdos or i8086-win16 targets. For other targets you need to replace them (and even for the mentioned targets it's more portable if you do so), for example with Pascal code (e.g. for FlagIsSet) or by calls to existing functions (e.g. SetJump and LongJump are provided by FPC as are replacements for HiWord, LoWord or SwapWord).

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8902
  • FPC developer.

Quote
Quote from: marcov link=topic=51989.msg382429#msg382429
date=1604092664
Do you use the 16-bit compiler?

Borland Pascal 7.0 Full.

(https://funkyimg.com/p/38jYN.png)

As this is a Free Pascal forum, I meant the 16-bit Free Pascal msdos compiler. Logically that is the most compatible target to BP 7 dos.
« Last Edit: October 31, 2020, 12:52:51 pm by marcov »

 

TinyPortal © 2005-2018