473,378 Members | 1,360 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,378 software developers and data experts.

inline assemble in vc

I overloaded operator+ in a class, and I want to invoke this
operator in inline assemble like this:
_asm call operator+
but it cannot be complied OK. compiler says there are some illegalI
opcodes, and I'm absolutely sure that all the other codes are OK.
actually I don't know how to invoke overloaded operator in inline
assamble, I write this referring to the deassemble code by vc. who can
tell me how to invoke overloaded operator correctly in inline assemble.
Thank You Very Much In Advance.

Nov 25 '06 #1
3 1861
st******@gmail.com wrote:
I overloaded operator+ in a class, and I want to invoke this
operator in inline assemble like this:
_asm call operator+
but it cannot be complied OK. compiler says there are some illegalI
opcodes, and I'm absolutely sure that all the other codes are OK.
actually I don't know how to invoke overloaded operator in inline
assamble, I write this referring to the deassemble code by vc. who can
tell me how to invoke overloaded operator correctly in inline assemble.
Thank You Very Much In Advance.
Off topic here, try a group dedicated to your compiler.

--
Ian Collins.
Nov 25 '06 #2

st******@gmail.com wrote:
I overloaded operator+ in a class, and I want to invoke this
operator in inline assemble like this:
_asm call operator+
but it cannot be complied OK. compiler says there are some illegalI
opcodes, and I'm absolutely sure that all the other codes are OK.
actually I don't know how to invoke overloaded operator in inline
assamble, I write this referring to the deassemble code by vc. who can
tell me how to invoke overloaded operator correctly in inline assemble.
Thank You Very Much In Advance.
operator + (a,b) is a function like any other so write a small sample
code that uses the operator+ and get your compiler to produce some
assembler output. Look at the actual name of the function called (turn
off optimisation to show the function being called maybe), which will
probably be something long and weird and use that name instead of
operator+,

Unfortunately some compilers change function names in assembler IIRC
so you should check your compiler manual for details.

Also bear in mind that if you have an optimising compiler you will
invariably lose by using assembler ;-) but I guess its fun to see how
the compiler does stuff so go for it...

regards
Andy Little

regards
Andy Little

Nov 25 '06 #3
<st******@gmail.comwrote in message
news:11*********************@14g2000cws.googlegrou ps.com...
I overloaded operator+ in a class, and I want to invoke this
operator in inline assemble like this:
_asm call operator+
but it cannot be complied OK.
Why do you need to call the operator from assembly language?
compiler says there are some illegalI
opcodes, and I'm absolutely sure that all the other codes are OK.
Humm. Better double check if you violate the instruction-set. Check the
syntax as well...
actually I don't know how to invoke overloaded operator in inline
assamble, I write this referring to the deassemble code by vc. who can
tell me how to invoke overloaded operator correctly in inline assemble.
Thank You Very Much In Advance.
Well, you have to disassemble the code, at get the name, function pointer,
and figure out the calling convention, and just call it. It might not have a
CABI...

Nov 25 '06 #4

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

Similar topics

47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
20
by: Grumble | last post by:
Hello everyone, As far as I understand, the 'inline' keyword is a hint for the compiler to consider the function in question as a candidate for inlining, yes? What happens when a function with...
2
by: alphatan['a:lfa:ta2n] | last post by:
ASSUME: 1.There's no symbol table of my program. 2.gdb, is my only choice. 3.disassembly code of my program(snatch): 0x08048340 <main+24>: push $0x804840d 0x08048345 <main+29>: call ...
7
by: lxrocks | last post by:
Hi, I am looking for some C routines that disassemble/assemble MSN Messenger packets and more if possible. Are there any open / shareware tools around ? tks
1
by: Mike Walters | last post by:
Reading the current Namespace.Class, Assemble at runtime I am trying to get the Assemble, Namespace and Class name of a form at runtime. I have several assembles and namespaces in my app, I...
0
by: Just Me | last post by:
When I try to add an AddressControl usercontrol to a form I get the message. An exception occurred while trying to create an instance of AddressControlNS.AddressControl... The exception was...
2
by: TPK | last post by:
Is there any way javascript can be used to assemble a XML file? Any resources out there that may explain how to do this (if possible)? TPK
1
by: Vladimir M | last post by:
Hi everybody! I have SUSE 10 (SLES). I have downloaded PostgreSQL 8.3 from www.postgersql.org. While I compile it, I recieved error: make: *** Absent rule for target assemble...
6
by: BigT | last post by:
I'm new to the world of C and try to start walking. I have below code in assemble language and would like to compile it in C. Can someone let me know how to and/ or do it? ; set processor...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.