Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9045233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:14:19+00:00 2026-06-16T11:14:19+00:00

I used netbeans in Windows 7 as my IDE. And below is my assembly

  • 0

I used netbeans in Windows 7 as my IDE. And below is my assembly code:

/* Atomic exchange (of various sizes) */
inline void *xchg_64(void *ptr, void *x)
{
    __asm__ __volatile__("xchgq %0,%1"
                :"=r" ((unsigned long long) x)
                :"m" (*(volatile long long *)ptr), "0" ((unsigned long long) x)
                :"memory");

    return x;
}

When I compile my project, there’s one error occurs:

tklock.h:29:15: error: lvalue required in asm statement

And line 15 is:

:"memory");

How to fix the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:14:22+00:00Added an answer on June 16, 2026 at 11:14 am

    There is no way to directly exchange the values of two memory locations. Intel just hasn’t provided that kind of instructions.

    You will have to code it as load-exchange-store using a register as an intermediary.

    And in that case you could just as well code it in C…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used code:blocks as the C++ IDE on Windows. I switched to netbeans 6.8
I used Netbeans IDE to compile and run the below program. public class Unicode
I used this code previously in netbeans 6.9.1 but it does not seem to
Until recently, I've used Symfony 1 and NetBeans IDE. In Netbeans, I could use
I'm using NetBeans 7.1 on Windows 7. I downloaded the CUnit archive and used
I've used NetBeans plugin Axis2 Support to create webservice from my pojo class. When
I have written a C++ program for a University assignment. I used Netbeans 6.8
I have used the Netbeans GUI Designer to come up with a JFrame and
In the Java Desktop Application template used by Netbeans, a menu bar is created
I'm working for a Swing Project and the technologies used are netbeans with Toplink

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.