Thread: g++ at&t inline asm to bcc32

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    61

    g++ at&t inline asm to bcc32

    would some kind soul please translate this g++ inline asm snippit to one compatable with Borland bcc32 ver 5.5


    Thank you


    James


    Code:
    
    void set_fpu (unsigned int mode)
    {
      asm ("fldcw %0" : : "m" (*&mode));
    }

  2. #2
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    It loads word (16-bit) and your variable "mode" is 32-bit. Not that it doesn't work, but you have to be careful.

    Try this:

    Code:
    void set_fpu(unsigned short mode)
    {
        __asm
        {
            fldcw mode
        }
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bcc32 and huge declarations
    By Rich G. in forum C Programming
    Replies: 4
    Last Post: 01-10-2012, 04:06 PM
  2. small executable with bcc32
    By mpx in forum C++ Programming
    Replies: 3
    Last Post: 05-05-2005, 12:15 PM
  3. Builder 5 v's bcc32.exe
    By sononix in forum C++ Programming
    Replies: 3
    Last Post: 08-17-2004, 11:17 AM
  4. BCC32 Memory Issue
    By sononix in forum C Programming
    Replies: 5
    Last Post: 08-02-2004, 09:21 AM
  5. using bcc32
    By bigSteve in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2003, 04:08 PM
Website Security Test