Hi im a "newbie" and would like to use masm to produce .obj files to link with delphi code (i hear screams).

This would just be for the inner loops of programs which are very data intensive.You may know that up to Delphi5 you can only use the 486 set unless you use opcodes(db?). The Delphi6 assembler does support up to P4.

So the question is can I use newer processor instructions in masm (probably via radasm) ? I would be grateful of a small example. I tired an instruction or two but i got errors , it may just be (probably) my silly coding errors.

Many thanks.
Posted on 2001-10-18 07:40:57 by trancera
(i hear screams).

I see dead people!

In order to use mmx instructions on a processor, you need to specify .mmx.

There is also .xmm for the SIMD SSE instructions (SSE1 only I think). You can define macros (or possibly search the web for some) that'll do SSE2 for you.

I don't use Delphi, or have a copy to try stuff on. If its like C Builder, it'll use OMF object files rather than COFF, so you'll need to make sure you compile without the /c switch if you use MASM (the linker with MASM32 is a COFF linker).

First I would recomend trying to link a simple function into your code just to test it (eg. mov eax, 5 / ret), just to prove you've got the linking between the packages right. Then try bringing more complex stuff.

Posted on 2001-10-18 08:23:11 by Mirno
Thanks for the VERY quick reply Mirno.

I have tried some small functions. One odd thing ( maybe someone will say its not ) - and not that i fully understand the meaning or reasoning is that i have to define each function in its own segment or Delphi wont find the function.

Something like this ( template kinda file ).


_1_TEXT segment dword public 'CODE' use32
Procedure1 proc
Procedure1 endp
@CurSeg ends

_2_TEXT segment dword public 'CODE' use32
Procedure2 proc
Procedure2 endp
@CurSeg ends

I think its to do with what you say 'OMF' maybe ?
Yes the switches i am using ( so far ) are : /c /Cp /nologo /Fl /Sa /I$I,2

Does this segment thing make sense then ?
Is it expensive in terms of size/performance or negligible once you are in the required function ?

Thanks y'all.
Posted on 2001-10-18 08:33:21 by trancera