Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2018-11

How to move this, but in FPC 32bit?

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ozz Nixon

I have these last couple of lines to port to FPC -Mdelphi, but everything I try fails...

Asm
MOV PreviousUnitAddressOffset,
TUnitHeader.PreviousUnitAddress
MOV PreviousLibraryUnitAddressOffset,
TUnitHeader.PreviousLibraryUnitAddress
MOV AncestorTypeDefinitionOffset,
TObjectTypeDefinition.AncestorTypeOffset
MOV OrdinalTypeDefLowerLimitOffset, TOrdinalTypeDefinition.LowerLimit MOV OrdinalTypeDefUpperLimitOffset, TOrdinalTypeDefinition.UpperLimit end;

Thanks.

Reply by email

Marco van de Voort
to Ozz Nixon

Op 11/12/2018 om 4:37 PM schreef Ozz Nixon:

I have these last couple of lines to port to FPC -Mdelphi, but everything I try fails...

Well, it doesn't compile in delphi either. Seems it is not a complete program.

Reply by email

Ozz Nixon
to Marco van de Voort

Its from D7... and does compile.

On Mon, Nov 12, 2018 at 5:59 PM Marco van de Voort <

Show quoted text 15 lines
wrote: Op 11/12/2018 om 4:37 PM schreef Ozz Nixon: I have these last couple of lines to port to FPC -Mdelphi, but everything I try fails... Well, it doesn't compile in delphi either. Seems it is not a complete program. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Ozz Nixon
to Ozz Nixon

Its part of 30+ units. In the main units Initialization...

PM Ozz Nixon wrote 19 lines
Its from D7... and does compile. On Mon, Nov 12, 2018 at 5:59 PM Marco van de Voort < > wrote: > > Op 11/12/2018 om 4:37 PM schreef Ozz Nixon: > > I have these last couple of lines to port to FPC -Mdelphi, but everything > I try fails... > > > Well, it doesn't compile in delphi either. Seems it is not a complete > program. > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel >

Reply by email

Sven Barth
to Ozz Nixon

Am Di., 13. Nov. 2018, 00:05 hat Ozz Nixon geschrieben:

Its part of 30+ units. In the main units Initialization...

We can't help you if we don't have a complete code snippet that should compile as only then we can test it ourselves. Otherwise we e.g. need to guess the types of the variables, potentially picking one that would compile and you wouldn't be helped either.

Regards,
Sven

Reply by email

Ralf Quint
to Ozz Nixon: I have these last couple of lines to port to FPC -Mdelphi, but everything I try fails...…
Ozz Nixon wrote 12 lines
I have these last couple of lines to port to FPC -Mdelphi, but everything I try fails... Asm     MOV PreviousUnitAddressOffset, TUnitHeader.PreviousUnitAddress     MOV PreviousLibraryUnitAddressOffset, TUnitHeader.PreviousLibraryUnitAddress     MOV AncestorTypeDefinitionOffset, TObjectTypeDefinition.AncestorTypeOffset     MOV OrdinalTypeDefLowerLimitOffset,  TOrdinalTypeDefinition.LowerLimit     MOV OrdinalTypeDefUpperLimitOffset,  TOrdinalTypeDefinition.UpperLimit end;

Well, as others already mentioned, it is hard to give proper advice without having a reproducible piece of code.

Just looking at the snippet above, I would start with questioning if there isn't a more "Pascal way" to do this, whatever this piece of code is trying to accomplish...

Ralf

---
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

Ozz Nixon
to Ralf Quint

Thank you all ... I am on the road, when I get back, I will track down TUnitHeader, TObjectTypeDefinition, TOrdinalTypeDefinition - and post those structures. My problem was changing the above to simple:

   PreviousUnitAddressOffset:=TUnitHeader.PreviousUnitAddress;

does not work, I think they are constants - I will have to dig back through the code. (It's from 1995, written by Anders Hejlsberg, so it does a lot of odd ASM things).

Ozz

PM Ralf Quint wrote 36 lines
On 11/12/2018 7:37 AM, Ozz Nixon wrote: I have these last couple of lines to port to FPC -Mdelphi, but everything I try fails... Asm MOV PreviousUnitAddressOffset, TUnitHeader.PreviousUnitAddress MOV PreviousLibraryUnitAddressOffset, TUnitHeader.PreviousLibraryUnitAddress MOV AncestorTypeDefinitionOffset, TObjectTypeDefinition.AncestorTypeOffset MOV OrdinalTypeDefLowerLimitOffset, TOrdinalTypeDefinition.LowerLimit MOV OrdinalTypeDefUpperLimitOffset, TOrdinalTypeDefinition.UpperLimit end; Well, as others already mentioned, it is hard to give proper advice without having a reproducible piece of code. Just looking at the snippet above, I would start with questioning if there isn't a more "Pascal way" to do this, whatever this piece of code is trying to accomplish... Ralf <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=icon> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=link> <#m_-1587466564115926972_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Marco van de Voort
to Ozz Nixon

Op 2018-11-14 om 13:44 schreef Ozz Nixon:

Show quoted text 9 lines
Thank you all ... I am on the road, when I get back, I will track down TUnitHeader, TObjectTypeDefinition, TOrdinalTypeDefinition - and post those structures. My problem was changing the above to simple:  PreviousUnitAddressOffset:=TUnitHeader.PreviousUnitAddress; does not work, I think they are constants - I will have to dig back through the code. (It's from 1995, written by Anders Hejlsberg, so it does a lot of odd ASM things).

Internal identifiers are not always the same between FPC and Delphi. It might not be possible at all, so you need to find out why these are needed.

Reply by email

Ralf Quint
to Marco van de Voort
Marco van de Voort wrote 14 lines
Op 2018-11-14 om 13:44 schreef Ozz Nixon: > Thank you all ... I am on the road, when I get back, I will track > down TUnitHeader, TObjectTypeDefinition, TOrdinalTypeDefinition - and > post those structures. My problem was changing the above to simple: >  PreviousUnitAddressOffset:=TUnitHeader.PreviousUnitAddress; > > does not work, I think they are constants - I will have to dig back > through the code. (It's from 1995, written by Anders Hejlsberg, so it > does a lot of odd ASM things). > Internal identifiers are not always the same between FPC and Delphi. It might not be possible at all, so you need to find out why these are needed.

+1

I was not sure, having nothing but that little snippet of code, if this was something trying to do internal to the compiler or if that was part of some data conversion tool.

If this is indeed accessing some Delphi internal data structures, I think nobody can seriously expect FreePascal to be binary compatible. It is (tries to be) source code compatible, as much as feasible. But anything beyond that,...

Ralf

---
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email