With about Intel syntax error

This is a discussion on With about Intel syntax error within the Windows Programming forums, part of the Platform Specific Boards category; Hi.I havew a problem about with intel syntax.I use GCC.Hre is my code: Code: #include <stdio.h> int main() { asm(".intel_syntax ...

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    1

    With about Intel syntax error

    Hi.I havew a problem about with intel syntax.I use GCC.Hre is my code:
    Code:
    #include <stdio.h>
    
    int main()
    {
      asm(".intel_syntax noprefix\n"
      "PUSH EBP\n"
      "PUSH ECX\n"
      "MOV EAX,DWORD PTR SS:[EBP-4]\n"
      "MOV DWORD PTR SS:[EBP-4],EAX\n"
      "SHL EAX,4\n"
      "SHR EAX,4\n"
      "ADD EAX,0x0F\n"
     "ADD EAX,0x0F\n"
     "MOV EAX,0\n"
     "AND ESP,0xFFFFFFF0\n"
     "SUB ESP,8\n"
     "MOV EBP,ESP\n"
     "PUSH EBP\n"
      );
          
      return 0;
    }
    And my output message:
    Assembler messages:
    `movl $0,%eax'

    Where is my error.Thank you for your helps

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    1,624
    You should switch back to AT&T every time, because the compiler produces AT&T assembly, unless you issue a cmdline option "-masm=intel"
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error "in function 'main' syntax error before 'int' Help Please
    By blackhat11907 in forum C Programming
    Replies: 5
    Last Post: 08-20-2011, 07:05 PM
  2. Intel assembly syntax with GCC
    By Ktulu in forum Windows Programming
    Replies: 5
    Last Post: 05-27-2011, 06:05 AM
  3. error C2143: syntax error : missing ')' before ';'
    By steve1_rm in forum C Programming
    Replies: 4
    Last Post: 05-14-2008, 11:06 AM
  4. GCC compiler giving syntax error before 'double' error
    By dragonmint in forum Linux Programming
    Replies: 4
    Last Post: 06-02-2007, 05:38 PM
  5. Intel syntax on MinGW ?
    By TmX in forum Tech Board
    Replies: 2
    Last Post: 01-06-2007, 08:44 AM

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