Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 819
  • Last Modified:

C++ Builder 6 --> Linking to Assembly .OBJ Files

    How to use a C++ Builder 6 application to access data items defined in x86 assembly language files?
     The source code to the .OBJ files are available, as are the .OBJ files themselves.
     The ILINK32 linker is available.
     When viewing the C++ Builder 6 project's folder, there is an .OBJ file with the same name as the project.

     How to use ILINK to link the C++ Builder 6 .OBJ and the assembly language .OBJ files?
     Does a Module Definition File (or anything else) need to be used to define code and data segments during the linking process?
     What are examples of data item definitions (on both the C++ and assembly sides) that allow the C++ project and the assembly files to exchange data?

     I haven't found the information for all this.
0
apx_31088
Asked:
apx_31088
1 Solution
 
pmdwCommented:
Hi
I am assuming you have a file eg
myassembler.asm
;with code here
Code_seg@
 Func@  my_assm_func
....
end

you will then need to have a
myassembler.h
/*with func declaration here */
void _FAR * my_assm_func();

Note you will have to look at the calling convention definitions you are using
(ie stdcall,  cdecl )

Then you would add the myassembler.asm file to your project (shift+f11)
When you want to call my_assm_func() you incude the header
  #include "myassembler.h"

The rest of the build and compile is standard cbuilder

Note AFAIK This uses the turbo assmbler (tasm) to compile the .asm files in the build
process this has caused probems in once for me.

0
 
Jose ParrotGraphics ExpertCommented:
Hi,

A very complete tutorial on this subject is at http://www2.arnes.si/~ssdudzin/
It isn't specific to Borland Builder C++ but the examples can be adapted to it.

Jose
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now