Use token pasting.
#define CSYM(a) a
#define CSYM(a) _##a
mov eax, CSYM(c_var_name)
Wouldn't that work? It's a bit more cumbersome, but I believe
it is better than enforcing the use of nasm. I believe it would
be best to keep the SW requirements to a minimum so that it
encourages as many people as possible to work on the code base.
Most of us have very little time, and, frankly, I don't want to
waste it installing nasm.
Note: I don't use token pasting, so the above code could be totally
Senior Software Engineer
Cascade Microtech, Inc.
From: John Funnell [mailto:[email protected]]
Sent: Thursday, February 01, 2001 08:57
To: Arpi; [email protected]
Subject: Re: [Opendivx] linux mmx decore...
This is a good idea. Only (minor) problem is that you need a leading
underscore on every symbol for Windows and not for Gnu.
Could you Windows guys on the list cope with installing nasm and entering a
custom build step into your project? ;-)
Here's a summary of the three approaches for using assembler in our project
(let's ignore gas .s files):
(1) ** C with inline Intel-syntax **
In Windows Windows: easy, use M$'s compiler
In Gnu/linux: you have 4 options
a. use wine to run cl.exe (or perhaps icl.exe though i haven't tried it yet)
b. run the code through intel2gas then use gcc/gas
c. wait for gcc to support inline intel syntax
d. hope that intel ports their compiler to linux
e. import a .o file compiled by someone who has one of the above!!
(2) ** C with inline gas (AT&T) syntax ** (I believe this is obsolescent)
In Windows: use cygwin/gcc
In Gnu/linux: use gcc
(3)** nasm format assembler files **
In Windows: use nasm
In Gnu/linux: use nasm
For now option (1), C with inline Intel-syntax, is the projectmayo prefered
option. I'm sure everyone understands that is very important that we know
where the master, best, fastest MMX/SSE code is. Ideally we should have
code that will build on any x86 platform. nasm looks like that it might be
Opendivx mailing list
Local References / HOW-TO / FAQs