Like Tree1Likes
  • 1 Post By kmdv

g++ at&t inline asm to bcc32

This is a discussion on g++ at&t inline asm to bcc32 within the C++ Programming forums, part of the General Programming Boards category; would some kind soul please translate this g++ inline asm snippit to one compatable with Borland bcc32 ver 5.5 Thank ...

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

    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
    682
    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
        }
    }
    stahta01 likes this.
    I never put signature, but I decided to make an exception.

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, 03:06 PM
  2. small executable with bcc32
    By mpx in forum C++ Programming
    Replies: 3
    Last Post: 05-05-2005, 11:15 AM
  3. Builder 5 v's bcc32.exe
    By sononix in forum C++ Programming
    Replies: 3
    Last Post: 08-17-2004, 10:17 AM
  4. BCC32 Memory Issue
    By sononix in forum C Programming
    Replies: 5
    Last Post: 08-02-2004, 08:21 AM
  5. using bcc32
    By bigSteve in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2003, 03:08 PM

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