473,396 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Linking ASM Object File to C++ Program

I'm trying to link this ASM file:

..486
..model flat
..stack
..code
_sample proc
push ebp
mov ebp,esp
sub esp,8
push eax
mov eax,[ebp+4]
mul dword ptr[ebp+8]
add eax,10
pop eax
mov esp,ebp
pop ebp
ret
_sample endp
end _sample

to this C++ program:

#include <iostream>
#include <cstdlib>
using std::cout;
using std::endl;
using std::system;
extern "C" {int sample();}
int main()
{
cout << sample() << endl;
system("PAUSE");
return EXIT_SUCCESS;
}

My compiler is Dev-Cpp and my assembler is MASM32. Am I supposed to
create a project w/ the ASM file's object file in it, or what? Any help
would be greatly appreciated. Thanks!!!!

Aug 8 '06 #1
1 2829
Protoman wrote:
I'm trying to link this ASM file:
[..]

to this C++ program:

#include <iostream>
#include <cstdlib>
using std::cout;
using std::endl;
using std::system;
extern "C" {int sample();}
int main()
{
cout << sample() << endl;
system("PAUSE");
return EXIT_SUCCESS;
}

My compiler is Dev-Cpp and my assembler is MASM32. Am I supposed to
create a project w/ the ASM file's object file in it, or what? Any
help would be greatly appreciated. Thanks!!!!
We cannot help you with that. This is a _language_ newsgroup, not
"how to use my development environment" newsgroup. Your C++ code is
fine. Cross-language programming is platform- and implementation-
specific. You need to ask in the newsgroup dedicated to your OS or
your compiler.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Hagelberg | last post by:
I'm trying to create a python module which can be used by a python interpreter embedded inside a fortran program I have. To do this, I first created python wrappers for all the functions in my...
0
by: Dibyendu Roy | last post by:
Hi All, I build an object called "dblorcle" to connect to oracle database in Sun solaris box. This is built linking with various oracle ".a" (archived, for static linking) files come with standard...
0
by: SM | last post by:
Hi, While linking orbix C++ application, we get a lot of linking errors. Few errors are pasted below. If someone could tell us which are the libraries that need to be added, it would be of help....
15
by: Rob Ratcliff | last post by:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray X1. It makes heavy use of templates and namespaces. Up until the link step, the C++ source code compiled flawlessly. But, when...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
7
by: Hal Vaughan | last post by:
I have a problem with port forwarding and I have been working on it for over 2 weeks with no luck. I have found C programs that almost work and Java programs that almost work, but nothing that...
1
by: Trespasser | last post by:
Hi, When I try to execute a program called cnet I get an error like: $ cnet -s -m 1 STOPANDWAIT cnet: error while loading shared libraries: libelf.so.0: cannot open shared object file: No...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.