Calling asm routines from modula2 
Author Message
 Calling asm routines from modula2

Could someone please tell me if there is a relatively easy way to call
an assembly routine from the topspeed modula2 compiler v3?
        It doesn't seem to work very well if you compile some assembly with
tasm and then add a

#link compile(asm.obj)

command in the project file. Any other suggestions?

Cheers
Damon R



Fri, 09 Jan 1998 03:00:00 GMT  
 Calling asm routines from modula2

: Could someone please tell me if there is a relatively easy way to call
: an assembly routine from the topspeed modula2 compiler v3?
:       It doesn't seem to work very well if you compile some assembly with
: tasm and then add a

: #link compile(asm.obj)

: command in the project file. Any other suggestions?

no, except from using MASM 4,0 it is the same that I did
from 1.17 to 3.

more details would not be a hindrance to a solution.

cheers, engelbert

--
--------------------------------
- ASM-ISN Dept. SMC            -
- engelbert gruber             -
- peter fintl                  -
- helmut gragger               -

--------------------------------



Tue, 13 Jan 1998 03:00:00 GMT  
 Calling asm routines from modula2

  | Could someone please tell me if there is a relatively easy way to call
  | an assembly routine from the topspeed modula2 compiler v3?
  |     It doesn't seem to work very well if you compile some assembly with
  | tasm and then add a

  | #link compile(asm.obj)

  | command in the project file. Any other suggestions?

  | Cheers
  | Damon R

I don't know if it's easy, but it's the only way I know using an
externally compiled object file:

  1) Write a definition module for it, with appropriate pragmas (check the
  online help) telling there is no associated implementation source
  module, and for each procedure write the modula2 interface with pragmas
  around saying which registers are preserved / saved / used for
  parameters [/ used for return value].

  2) given 1) I am not sure the compiler system needs the object file to
  be mentionned in the project file if it has the name derived from the
  definition module name. With appriopriate paths and installation it
  should find the .asm source and compile it. BTW I seem to remember only
  MASM is supported as automatic external compiler; If you want to support
  TASM it should not be too difficult to update the configuration scripts
  and recompile them, replacing MASM with TASM.

Sorry for the approximations, but I didn't work with TS since a long
time... I now only work under Linux, and Mocka is quite...mmh...different :-(

Best regards,
Fabien.

--

,---------------------------.
| Fabien COUTANT            |
| Steria                    |
| 12, rue Paul DAUTIER      |
| 78140 VELIZY VILLACOUBLAY |
| FRANCE                    |
`---------------------------'



Tue, 13 Jan 1998 03:00:00 GMT  
 Calling asm routines from modula2

Quote:
>Could someone please tell me if there is a relatively easy way to call
>an assembly routine from the topspeed modula2 compiler v3?
>    It doesn't seem to work very well if you compile some assembly with
>tasm and then add a
>#link compile(asm.obj)
>command in the project file. Any other suggestions?

Yiou don't say where your trouble starts; but if you're converting
from V1.17 to V3 you should be aware that default parameter passing
conventions changed.

Have you followed the naming conventions for your assembler PUBLICs
that will allow you to use Modula 2 module/item names?

The best sources of information are in the Techkit manual Chapter 5,
and the sample code in 'ADemo.a' which illustrates all the things to
take account of in Assembler modules. Though it is in TopSpeed's
horrible Assembler dialect the principles will apply generally.

OTOH if you can be more specific about your problems it should be
possible to give more specific advice.

Martin Rand            | Tel: (44) 1703 252445 |
Highfield Software Ltd | Fax: (44) 1703 252445 |
Southampton, UK        |                       |



Tue, 13 Jan 1998 03:00:00 GMT  
 Calling asm routines from modula2

Quote:
>Could someone please tell me if there is a relatively easy way to call
>an assembly routine from the topspeed modula2 compiler v3?
>    It doesn't seem to work very well if you compile some assembly with
>tasm and then add a
>#link compile(asm.obj)

I don't think "link compile" is a valid project command.  Try

#pragma link(asm.obj)

I presume that you already know that for this to work you also
need an ASM.DEF file.
--

                           file://ee.newcastle.edu.au/pub/www/Moylan.html



Sun, 18 Jan 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. newbie question: calling asm routines from c

2. newbie question: calling asm routines from c

3. creating asm routine calls

4. Routine call in Routine

5. Interfacing C routine with CVF routine called from VB

6. GCC inline ASM -- calling C functions from __asm__

7. GCC inline ASM -- calling C functions from __asm__ blocks

8. Logitech Modula2 PCDOS Exec/System call wanted

9. Modula2 Novell Calls

10. UNIX calls from Modula2 (HELP!)

11. Interrupt Service Routine in asm help wanted

12. Modula2 for Apollos and Ada,Modula2 question(s)

 

 
Powered by phpBB® Forum Software