Solved

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

Posted on 2006-10-25
2
773 Views
Last Modified: 2013-11-17
    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
Comment
Question by:apx_31088
2 Comments
 
LVL 2

Accepted Solution

by:
pmdw earned 500 total points
Comment Utility
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
 
LVL 18

Expert Comment

by:JoseParrot
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now