Discussion:
[fpc-devel] How to move this, but in FPC 32bit?
Ozz Nixon
2018-11-12 15:37:11 UTC
Permalink
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.
Marco van de Voort
2018-11-12 15:57:56 UTC
Permalink
Post by 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.
Ozz Nixon
2018-11-12 23:03:53 UTC
Permalink
Its from D7... and does compile.

On Mon, Nov 12, 2018 at 5:59 PM Marco van de Voort <
Post by 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.
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Ozz Nixon
2018-11-12 23:04:41 UTC
Permalink
Its part of 30+ units. In the main units Initialization...
Post by Ozz Nixon
Its from D7... and does compile.
On Mon, Nov 12, 2018 at 5:59 PM Marco van de Voort <
Post by 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.
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Sven Barth via fpc-devel
2018-11-13 06:52:25 UTC
Permalink
Post by Ozz Nixon
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
Ralf Quint
2018-11-13 18:31:08 UTC
Permalink
Post by 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;
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
Ozz Nixon
2018-11-14 12:44:21 UTC
Permalink
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
Post by 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;
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>
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Marco van de Voort
2018-11-14 12:45:42 UTC
Permalink
Post by Ozz Nixon
Thank you all ... I am on the road, when I get back, I will track down
TUnitHeader, TObjectTypeDefinition, TOrdinalTypeDefinition - and post
 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.


_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/
Ralf Quint
2018-11-14 19:07:55 UTC
Permalink
Post by Marco van de Voort
Post by Ozz Nixon
Thank you all ... I am on the road, when I get back, I will track
down TUnitHeader, TObjectTypeDefinition, TOrdinalTypeDefinition - and
 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

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.fre

Continue reading on narkive:
Loading...