At the risk of appearing a dinosaur, I have some old C++ code, compiled with Borland C++, which sets registers, and interfaces to an Assembler module, which I would like to modernize. I have just installed MS VC++ Express, and needless to say a lot of things don’t work! The default seems to be Win32, which is fine, so I have blanked out FAR and HUGE. PASCAL seems to map to __stdcall. So I have a macro
#define THRCOMP extern "C" int FAR PASCAL _Export
where THRCOMP goes in front of a module name. This presumably results in something like
extern "C" int __stdcall _Export <modname>;
which the compiler doesn’t like, and puts out a message about an “anachronism” (doesn’t say what!). What is wrong?
Also the old code sets has in-line Assembler which I need to turn into a separately compiled subroutine – is there a (free) Assembler, and can it link Assembler obj decks in with C++?
By the way, I can’t see my obj decks – but WinZip picked them up! Explanation?
Generally, is there a guide to migrating old C++ code?
Thanks in advance.
A couple of specific things from your example:
_Exportat all.__stdcall) on a data declaration. If<modname>doesn’t have parens it’s a data declaration and the modifiers don’t do anything. If<modname>is a function implemented in assembly, you should still have the declaration include the argument list.For example:
You can get a free assembler from the Windows Driver Kit (WDK – what used to be called the DDK), but if you’re current code is written using Borland’s TASM compiler it might not be using the same syntax so there might be quite a bit of work porting it. However, if the current assembler is 16-bit code, you’re going to have a lot of work porting it to 32-bit assembler anyway…