 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
starffly@gmail.com Guest
|
Posted: Sat Nov 25, 2006 8:58 am Post subject: 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. |
|
| Back to top |
|
 |
Ian Collins Guest
|
Posted: Sat Nov 25, 2006 9:08 am Post subject: Re: inline assemble in vc |
|
|
starffly (AT) gmail (DOT) com wrote:
| Quote: | 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. |
|
| Back to top |
|
 |
Chris Thomasson Guest
|
Posted: Sat Nov 25, 2006 10:11 am Post subject: Re: inline assemble in vc |
|
|
<starffly (AT) gmail (DOT) com> wrote in message
news:1164423481.453912.68140 (AT) 14g2000cws (DOT) googlegroups.com...
| Quote: | 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?
| Quote: | 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...
| Quote: | 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... |
|
| Back to top |
|
 |
kwikius Guest
|
Posted: Sat Nov 25, 2006 10:11 am Post subject: Re: inline assemble in vc |
|
|
starffly (AT) gmail (DOT) com wrote:
| Quote: | 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 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|