Using "asm" statement

This is a discussion on Using "asm" statement within the C Programming forums, part of the General Programming Boards category; Hi users, Please tell me the correct format of "asm" statement. Is it asm { .....; .....; } or asm("...."); ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    4

    Question Using "asm" statement

    Hi users,
    Please tell me the correct format of "asm" statement.
    Is it

    asm
    {
    .....;
    .....;
    }

    or

    asm("....");
    asm("....");

    ?
    Thanks,

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Both are acceptable, but it really depends on your implementation. Check your compiler's help files for the exact syntax.
    My best code is written with the delete key.

  3. #3
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    I know Borland uses the first because I've used asm in that. Gcc, I believe, uses the second since the DOS port (DJGPP) of it mentions it in their documentation.

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379
    Borland uses both formats but as Prelude said you need to check with your compilers docs to make sure.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    If you are using the microsoft compiler, it would be _asm { }.

  6. #6
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Also note that gcc I believe uses different asm syntax. I believe it uses "AT&T" syntax insted of "Intel".

    Correct me if im wrong. ( I often am ).
    What is C++?

  7. #7
    ---
    Join Date
    May 2004
    Posts
    1,379
    yes thats right
    gcc uses at&t
    im sure most others use intel style

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Usefulness of the "else if" statement
    By gn17 in forum C Programming
    Replies: 7
    Last Post: 08-12-2007, 05:19 AM
  2. If Else statement problem
    By doofusboy in forum C Programming
    Replies: 2
    Last Post: 11-09-2005, 06:18 AM
  3. if/break statement
    By Apropos in forum C++ Programming
    Replies: 7
    Last Post: 02-22-2005, 01:33 PM
  4. string & if statement
    By Curacao in forum C++ Programming
    Replies: 4
    Last Post: 05-02-2003, 09:56 PM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 03:49 PM

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