Results 1 to 5 of 5

Thread: how to convert inline asm from VC++ to gcc ( Qt creator )

  1. #1
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default how to convert inline asm from VC++ to gcc ( Qt creator )

    i code to get CPU ID by VC++, but when i paste it to Qtcreator then it cant run, can you help me convert it , thanks

    Qt Code:
    1. //_____________________
    2. unsigned long getCPUID()
    3. {
    4. unsigned long CPU_ID;
    5. __asm
    6. {
    7. mov eax, 80000001h
    8. CPUID
    9. mov CPU_ID, edx
    10. };
    11. return CPU_ID;
    12. }
    To copy to clipboard, switch view to plain text mode 
    Contact: Skype: sonnh89
    Yahoo: nhs_0702@yahoo.com

    Liên hệ SKype: sonnh89

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: how to convert inline asm from VC++ to gcc ( Qt creator )

    "It can't run" isn't very helpful. What, exactly, does it not do? Fail to compile? Fail to produce output when run? Crash? What, if any, error messages are produced? What system and compiler are you using?

  3. #3
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to convert inline asm from VC++ to gcc ( Qt creator )

    i run source code on Qt ( mingw32) on windows 7, Fail to compile beacause mingw dont understand asm inline as VC++
    Contact: Skype: sonnh89
    Yahoo: nhs_0702@yahoo.com

    Liên hệ SKype: sonnh89

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to convert inline asm from VC++ to gcc ( Qt creator )

    What steps did you follow to try and port the code yourself? Did you read the GCC inline assembly howto? http://www.ibiblio.org/gferg/ldp/GCC...bly-HOWTO.html

  5. #5
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: how to convert inline asm from VC++ to gcc ( Qt creator )

    More to the point, read this. You can't expect a different compiler to recognize compiler-specific constructs used by another compiler.

Similar Threads

  1. QT + mingw and 'inline' functions?
    By tonnot in forum Newbie
    Replies: 6
    Last Post: 25th February 2011, 11:43
  2. How to start a thread (inline)
    By DiamonDogX in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2009, 22:53
  3. inline function in qdatetime.h
    By jamadagni in forum Newbie
    Replies: 1
    Last Post: 17th March 2007, 10:28
  4. Inline functons causing Havoc
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2006, 07:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.