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 7626225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:17:50+00:00 2026-05-31T05:17:50+00:00

I am doing some cross-platform work, porting code from Linux to Win32, but when

  • 0

I am doing some cross-platform work, porting code from Linux to Win32, but when it comes to some assembly code, I cannot get it to work.
This code compiles normally in Linux gcc, but will not work in VS2008 –win32.

Some of my code is below. What do I need to do if I want to compile it using VS2008 –win32 platform:

static inline void spin_wait(int n)
{
    int    tmp = n;
    while(tmp > 0) { tmp--; asm("" ::: "memory", "cc"); }
}

__asm__ __volatile__(
    "xorq        %%rdx, %%rdx    \n"
    "xorq        %%rax, %%rax    \n"
    "incq        %%rdx        \n"
    "lock cmpxchgq    %%rdx, (%1)    \n"
    "decq        %%rax        \n"
: "=a" (not_set) : "r" (n) : "%rdx");
  • 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-05-31T05:17:51+00:00Added an answer on May 31, 2026 at 5:17 am

    If your question is about the use of inline assembly, you can still use it in Visual Studio (MSDN link) although you may need to tweak it for the platform of course.

    For example:

    __asm {
       mov al, 2
       mov dx, 0xD007
       out dx, al
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some cross platform DNS client code that I use for doing end
I was interested in doing some cross platform work with a usb device in
I'm doing some fairly simple cross-platform TCP socket programming. I have unfortunately found out
Doing cross platform development with 64bit. Using gcc/linux and msvc9/server 2008. Just recently deployed
I'm doing some cross platform development, and I ran across another weird problem.. namespace
We are doing some cross platform development on OSX with Paralells installed with different
After doing some work with Ruby, Rails, and RSpec last summer and I learned
I'm doing some work for a charity that's having a fund drive. Whenever someone
I like F# but sometimes I need something light and cross-platform and without .NET
Of course, I know the best answer is don't write your own cross-platform code,

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.