Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > inline assemble in vc

Reply
Thread Tools

inline assemble in vc

 
 
starffly@gmail.com
Guest
Posts: n/a
 
      11-25-2006
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.

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      11-25-2006
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.
 
Reply With Quote
 
 
 
 
kwikius
Guest
Posts: n/a
 
      11-25-2006

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

 
Reply With Quote
 
Chris Thomasson
Guest
Posts: n/a
 
      11-25-2006
<> wrote in message
news: 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...



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Software to assemble many small digital pics into a poster? Anonymous Digital Photography 5 10-26-2004 02:06 PM
Looking for some C libraries to assemble/dissamble MSN messengerpackets lxrocks C Programming 7 08-11-2004 11:06 PM
gdb: insert assemble code but NOT machine? alphatan['a:lfa:ta2n] C Programming 2 12-18-2003 09:51 AM
Dis assemble C code vrk1981 C Programming 1 07-25-2003 12:37 AM
how to assemble a pc : guide Robert Schumacher Computer Support 4 07-03-2003 02:37 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57