inline asm portability

C

Cristian Tota

I am programming Visual C++ 6.0, using inline asm. MSDN says that code with
inline asm is not fully portable to other hardware platforms. What does this
reffer to? On what platforms isn't the code portable?

Cristian
 
L

lilburne

Cristian said:
I am programming Visual C++ 6.0, using inline asm. MSDN says that code with
inline asm is not fully portable to other hardware platforms. What does this
reffer to? On what platforms isn't the code portable?

Any platform that does not use the processor for which your
ASM is written for (MIPS, Motorola, SPARC, ..., etc) and
probably also any platform that is not windows too.
 
M

Moonlit

Hi,

Cristian Tota said:
I am programming Visual C++ 6.0, using inline asm. MSDN says that code with
inline asm is not fully portable to other hardware platforms. What does this
reffer to? On what platforms isn't the code portable?
Any Processor that is not x86 and in addition to that, if you use assembly
instructions for newer processors it won't run on older ones and in addtion
to that using 32 bit segment code is likely not compatible with 16 bit
segment code.
Regards, Ron AF Greve.
 
J

Jack Klein

I am programming Visual C++ 6.0, using inline asm. MSDN says that code with
inline asm is not fully portable to other hardware platforms. What does this
reffer to? On what platforms isn't the code portable?

Cristian

Not just hardware platforms, other compilers for the same target.
Microsoft's implementation of inline assembly language is not
conforming to the C++ language standard at all. And it won't work
with compilers from Borland, GNU, or Microtec, just to name a few,
that target the same 32-bit x86 processors.

So what MSDN should say is that all Visual C++ code with inline
assembly language is completely non-portable and locked into Visual
C++ forever, unless you are willing to translate it.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
 
P

Pete Becker

Jack said:
So what MSDN should say is that all Visual C++ code with inline
assembly language is completely non-portable and locked into Visual
C++ forever, unless you are willing to translate it.

As should every other implementation. They all vary on register usage,
stack frame layout, assembler syntax, access to named variables, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top