
TopSpeed and Logitech Modula-2 linking
Quote:
> I would like to know if anyone has any knowledge of how to link object
>files from both Logitech and TopSpeed compilers together. Both compilers
>say in their reference manual that object files from other languages can
>be linked as long as you create a definition module. When I try to import
>a Logitech implementation module into a TopSpeed main module, the linking
>says that the import is unresolved. If I try to import Topspeed implemen-
>tations into Logitech main modules, the linker won't recognize the TopSpeed
>object file.
> Does anyone know whether they can actually be linked together or not?
To link a non-tsm2 module to tsm2 modules, one does indeed need a
definition module. You assume that the definition modules supplied by
logitech will do; if you think about what you are asking the complier and
linker to do, you will see that this is not reasonable. Each vendors
compiler will use different calling conventions, and each vendors
implementation modules will call other modules and ultimately their own
run-time libraries.
tsm2 has #pragma compiler directives, which can be used to specify what
goes in what registers, whether a stack frame is used, whether the caller
or the callee (?) tidies up the stack (if used) etc. This has to be in the
definition module, so that the compiler can produce the correct code to
call one of the foreign modules.
How logitech supports foreign modules I don't know; I have never used the
product.
Note: all the topspeed language products use a very efficient register
mechanism to pass parameters to a procedure; this is much faster than a
traditional stack frame. I believe that Microsoft et al are now copying
this enhancement.
Chris