Board index » delphi » .TPU to .OBJ

.TPU to .OBJ

Hi.

I would like to know if it was possible to convert a .TPU to a .OBJ file. Is there some
sort of program out there that does so? Anyway, I'd like some info on the TPU file
format (TP 7.0).

Thanks in advance

- Asbj?rn

 

Re:.TPU to .OBJ


Quote
Asbj?rn wrote:

> Hi.

> I would like to know if it was possible to convert a .TPU to a .OBJ file. Is there some
> sort of program out there that does so? Anyway, I'd like some info on the TPU file
> format (TP 7.0).

> Thanks in advance

> - Asbj?rn

Hi,

Why converting TPU's to OBJ's? TPU's are created by Borland for smart
linking; OBJ's are not dessigned for smart linking...

I had to say this...

Ciao, Nico.

Re:.TPU to .OBJ


Quote
Nico.DeSmedt wrote:

> Asbj?rn wrote:

> > Hi.

> > I would like to know if it was possible to convert a .TPU to a .OBJ file. Is there some
> > sort of program out there that does so? Anyway, I'd like some info on the TPU file
> > format (TP 7.0).

> > Thanks in advance

> > - Asbj?rn

> Hi,

> Why converting TPU's to OBJ's? TPU's are created by Borland for smart
> linking; OBJ's are not dessigned for smart linking...

> I had to say this...

> Ciao, Nico.

I'm kinda lazy, so I wondered if it was possible to convert a TPU to OBJ,
so that I could link it in my asm programs.

- Asbj?rn

Re:.TPU to .OBJ


Quote
In article <32914143.4...@sn.no> Asbj?rn wrote:
>Nico.DeSmedt wrote:

>> Asbj?rn wrote:

>> > Hi.

>> > I would like to know if it was possible to convert a .TPU to a.OBJ file. Is there some
>> > sort of program out there that does so? Anyway, I'd like someinfo on the TPU file
>> > format (TP 7.0).

>> > Thanks in advance

>> > - Asbj?rn

>> Hi,

>> Why converting TPU's to OBJ's? TPU's are created by Borland forsmart
>> linking; OBJ's are not dessigned for smart linking...

>> I had to say this...

>> Ciao, Nico.

>I'm kinda lazy, so I wondered if it was possible to convert a TPU toOBJ,
>so that I could link it in my asm programs.

>- Asbj

If you had a compiler that could generate an ASM output, about the
only thing you could use it for would be to get a "feel" for the
code generator.  With a Pascal that can generates OBJ output, you
will still find the obj's difficult to work with.  In the case of
TPU's, it would be almost impossible.

There are numerous problems.  Probably the most notable deal are
references to library, or system functions.  Many system functions
are non-standard, (e.g. are not Pascal) and are usually known only
by the compiler and linker.  None were designed for use my the
programmer.  Besides not being documented, their location is often
unknown.  In the case of TPU's, the location of system functions
are only known by the linker and can only be referenced by the
compiler.

Take a simple string assignment like  s := '123'.  The compiler
generates code to push the address of the string literal '123',
then to push the address of the target "s", then depending upon
the version may load a register or push the value of the maximum
allowable length of the target, then issues a call to a system
routine that is designed to make the actual assignment.

Similar things happen with multiplication and division of long
integers, all math involving 6-byte reals, and for numerous other
instructions.  

So. forfeit string manipulation, many math operations, etc., and
there is pathetically little remaining.  Just learning what can
and cannot be used is considerably more effort than most of us
would care to undertake.

Of course if you Pascal compiler was designed to generate and link
OBJ's, you probably would be able to link the necessary system
routines which would probably be supplied in a library.  Your task
would then be to insure the code use resource managers for the
target platform.  Your desire for OBJ's implies that you want to
link across languages.  You might be able to bloat the application
and include file i/o for both languages, but what about other
resources?  Do you have the skills necessary to get your Pascal
code to use "C" memory routines?

If ASM is your target, then your best bet would be to go the other
way and link your ASM code into TP/BP.  Personally I find TP 6.0
and 7.0 ideal Pascal/ASM environments.  I can use BASM to write
inline assembler, or {$L filename} to link external OBJ's.  It is
really simple.  You can even create routines that would allow you
external assembly routines to access memory resources and other
system routines.  

Instead of trying to get Pascal into another platform, think in
terms of importing the other platform into Pascal.  You have a
better chance of succeeding.

    ...red

Re:.TPU to .OBJ


Quote
R.E.Donais wrote:

> In article <32914143.4...@sn.no> Asbj?rn wrote:

> >Nico.DeSmedt wrote:

> >> Asbj?rn wrote:

> >> > Hi.

> >> > I would like to know if it was possible to convert a .TPU to a.OBJ file. Is there some
> >> > sort of program out there that does so? Anyway, I'd like someinfo on the TPU file
> >> > format (TP 7.0).

> >> > Thanks in advance

> >> > - Asbj?rn

> >> Hi,

> >> Why converting TPU's to OBJ's? TPU's are created by Borland forsmart
> >> linking; OBJ's are not dessigned for smart linking...

> >> I had to say this...

> >> Ciao, Nico.

> >I'm kinda lazy, so I wondered if it was possible to convert a TPU toOBJ,
> >so that I could link it in my asm programs.

> >- Asbj

> If you had a compiler that could generate an ASM output, about the
> only thing you could use it for would be to get a "feel" for the
> code generator.  With a Pascal that can generates OBJ output, you
> will still find the obj's difficult to work with.  In the case of
> TPU's, it would be almost impossible.

> There are numerous problems.  Probably the most notable deal are
> references to library, or system functions.  Many system functions
> are non-standard, (e.g. are not Pascal) and are usually known only
> by the compiler and linker.  None were designed for use my the
> programmer.  Besides not being documented, their location is often
> unknown.  In the case of TPU's, the location of system functions
> are only known by the linker and can only be referenced by the
> compiler.

> Take a simple string assignment like  s := '123'.  The compiler
> generates code to push the address of the string literal '123',
> then to push the address of the target "s", then depending upon
> the version may load a register or push the value of the maximum
> allowable length of the target, then issues a call to a system
> routine that is designed to make the actual assignment.

> Similar things happen with multiplication and division of long
> integers, all math involving 6-byte reals, and for numerous other
> instructions.

> So. forfeit string manipulation, many math operations, etc., and
> there is pathetically little remaining.  Just learning what can
> and cannot be used is considerably more effort than most of us
> would care to undertake.

> Of course if you Pascal compiler was designed to generate and link
> OBJ's, you probably would be able to link the necessary system
> routines which would probably be supplied in a library.  Your task
> would then be to insure the code use resource managers for the
> target platform.  Your desire for OBJ's implies that you want to
> link across languages.  You might be able to bloat the application
> and include file i/o for both languages, but what about other
> resources?  Do you have the skills necessary to get your Pascal
> code to use "C" memory routines?Errrhhh... Nope...
> If ASM is your target, then your best bet would be to go the other
> way and link your ASM code into TP/BP.  Personally I find TP 6.0
> and 7.0 ideal Pascal/ASM environments.  I can use BASM to write
> inline assembler, or {$L filename} to link external OBJ's.  It is
> really simple.  You can even create routines that would allow you
> external assembly routines to access memory resources and other
> system routines.

> Instead of trying to get Pascal into another platform, think in
> terms of importing the other platform into Pascal.  You have a
> better chance of succeeding.

>     ...red

Hmm.. that's the way I'm doing things right now. But, I just wondered if it was
possiblem coz it would be sort of, hmm, nice I guess :)

- Asbj?rn

Other Threads