Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-10-25
2
Medium Priority
?
814 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
pmdw earned 1500 total points
ID: 17810687
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:Jose Parrot
ID: 17817067
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

722 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