Does inline assembly still have to follow microprocessor instruction set?

This is a discussion on Does inline assembly still have to follow microprocessor instruction set? within the C++ Programming forums, part of the General Programming Boards category; Does inline assembly still have to follow microprocessor instruction set? Or is it automatic somehow?...

  1. #1
    Banned
    Join Date
    Jan 2003
    Posts
    1,708

    Does inline assembly still have to follow microprocessor instruction set?

    Does inline assembly still have to follow microprocessor instruction set? Or is it automatic somehow?

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Your question doesn't make any sense...

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    YES

    I'm not sure I understand your question, but, YES. The assembler converts each assembly language instruction to exactly one machine language instruction (microprocessor instruction set). The machine language is specific to the processor. (Although there is lots of compatibility between the various Intel x86 processors and between the x86 and AMD.) There is no way you can run Intel assembly on a Mac!
    Last edited by DougDbug; 01-29-2003 at 05:34 PM.

  4. #4
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    Your question doesn't make any sense...
    I was just asking if inline assembly in C++ still has to follow the instruction set of the processor you are using. Doesn't each processor have its own instruction set?

  5. #5
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    It doesn't "follow" a instruction set, it uses an instruction set. And yes, different processors use different instruction sets... the inline asm you're using must match the native asm for the machine you're compiling on.

  6. #6
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    It doesn't "follow" a instruction set, it uses an instruction set
    omg you can't be serious...lol

    If it 'uses' a certain set of instructions it seems to me it 'follows' it. We 'use' the C++ standard therefore we 'follow' it, but w/e you answered my question so I'm happy

  7. #7
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    Note that it not only needs to "follow" the instruction set of the machine you are using, it must also "follow" the way your compiler treats inline assembly.

  8. #8
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Originally posted by Shiro
    Note that it not only needs to "follow" the instruction set of the machine you are using, it must also "follow" the way your compiler treats inline assembly.
    Exactly.....for example VC++ uses a stripped down version of the MASM syntax.....and then that supports the intel instruction set (IA32)

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    Not if you're running a compiler on top of an emulator.
    Joe

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 10:06 AM
  3. C help for network animator
    By fastshadow in forum Tech Board
    Replies: 7
    Last Post: 03-17-2006, 02:44 AM
  4. C,C++,Perl,Java
    By brusli in forum C Programming
    Replies: 9
    Last Post: 12-31-2001, 02:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21