x86-64

CPUID implementations in C++

Hi, I would like to know if somebody around here has some good examples of a C++ CPUID implementation that can be referenced from any of the managed .net languages. Also, should this not be the case, should I be aware of certain implementation differences between X86 and X64? I would like to use CPUID to get info on the machine my sof...

Multiple threads and memory

I read in the Visual C++ documentation that it is safe for multiple threads to read from the same object. My question is: how does a X86-64 CPU with multiple cores handle this? Say you have a 1 MB block of memory. Are different threads literally able to read the exact same data at the same time or do cores read one word at a time with ...

Compiling assembly for X86/X64 for use with C#

I would like to add cpuid functionality to my C# app. I found this interesting blog post online. I will probably need MASM to compile this but: How should I start? I suspect that I will have to compile a dll for both X86 and X64 but again I don't have a clue about how to go about such a thing (and I am a bit pressed for time). So any...

Disassemble into x86_64 on OSX10.6 (But with _Intel_ Syntax)

I know of otool -tv, but I would much rather use the Intel syntax rather than AT&Ts, mainly to easily follow along in a book and not have to look over thousands of %'s and $'s. I'd also appreciate any tips to where I might find gdb's config file. EDIT: I forgot: I'm running a 64bit processor, but was wondering if it would be possible...

Precompiled headers and compiling universal objects on OSX

We are using precompiled headers with GCC for our project and build them like this: gcc $(CFLAGS) precompiledcommonlib.h Now I'm building the project on OSX 10.6 and trying to use the nifty feature of building for all architectures at the same time like this: gcc $(CFLAGS) -c -arch i386 -arch x86_64 commonlib.c However, it seems th...

How is the x64 architecture different from x86

I need to mess around with the stacks on these architecture and am really a n00b here. Any pointers to reading topics/google searches that i can do. I am looking for how these architectures are fundamentally different from each other. something more than the wikipedia article on this topic http://en.wikipedia.org/wiki/X64 ...

Benefits of x87 over SSE

I know that x87 has higher internal precision, which is probably the biggest difference that people see between it and SSE operations. But I have to wonder, is there any other benefit to using x87? I have a habit of typing -mfpmath=sse automatically in any project, and I wonder if I'm missing anything else that the x87 FPU offers. ...

10 character id that's globally and locally unique

Hi there! I need to generate a 10 character unique id (SIP/VOIP folks need to know that it's for a param icid-value in the P-Charging-Vector header). Each character shall be one of the 26 ASCII letters (case sensitive), one of the 10 ASCII digits, or the hyphen-minus. It MUST be 'globally unique (outside of the machine generating the i...

How do I determine whether an application I am installing is 32bit or 64bit?

I want to be able to predict the default install location of an application. On a 64 bit machine, if it is a 32bit application, it would install in "Program Files (x86)" and if it were a 64bit application, it would install in "Program Files". My goal is to install the application with its default location and validate if the install was...

NUnit "missing" GPSVC.DLL on Windows 7/64

I recently upgraded from Vista/32 to Win7/64. On my old machine, everything was working fine. Unfortunately, on my new machine NUnit won't load my unit tests, with the error message "System.IO.FileNotFoundException: Could not load file or assembly 'UnitTest' or one of its dependencies. The system cannot find the file specified". (Act...

How to intercept a hot key in Cocoa when the application window is not active

I am trying to create a utility that doesn't open a window when executed, and that would be activated from a hot key; I read that currently Cocoa doesn't have a function for that, and that I should use a deprecated Carbon function. Isn't there really a way to use global hot keys in Cocoa? What should I do: wait for Cocoa to introduce a ...

Ghostscript compatibility question between 8.15 and 8.70

Hi, I was using ghostscript 8.15 for pdf rasterization on a x86_64 system. Now because of new features I want to switch to version 8.70. However, I noticed that Ghostscript made a note about supporting only 32 bit postscript integers in version 8.70. I don't quite understand how this could affect the behavior of my application and was ...

Unauthorized Access Exception in Windows 7

Hello, I have an application which reads a license file when it starts up. My install creates the folder in Program Files for the application, creates the license folder and puts the license file in there. However when I try and run the application, it needs to read/update the license file. When I try and do that I get an "Unauthorized ...

How to get `gcc` to generate `bts` instruction for x86-64 from standard C?

Inspired by a recent question, I'd like to know if anyone knows how to get gcc to generate the x86-64 bts instruction (bit test and set) on the Linux x86-64 platforms, without resorting to inline assembly or to nonstandard compiler intrinsics. Related questions: Why doesn't gcc do this for a simple |= operation were the right-hand sid...

Creating a managed wrapper for 32bit and 64bit unmanaged DLL

Hi there, We are creating a C# wrapper around a unmanaged DLL. The unmanaged DLL comes in both a 32 and 64bit versions. We keep the managed wrapper in its own project so that we can build it as a separate component and reuse it across solutions. However this leads to some problems. Since the unmanaged DLL has the same name for both t...

Custom X86_64 calling convention to C function call

Hi stackoverflow I've to do an interface (say, a wrapper) that allow a call from X86_64 assembly code using his calling convention to C function, with other calling convention. The best thing would be to be pretty "compiler independant" (juste modifying the wrapper), so i'm looking for something that puts registers/stack stuff on compi...

Converting an x86 TortoiseSVN plugin to x64

I'm trying to convert a 32bit TortoiseSVN-plugin (an IBugTraqProvider implementation) we've written so that It will work on TortoiseSVN x64; but I'm struggling with what I need to change to make it work. Are there any specific tools that would help or does anyone know what types of things would need to be changed (references/IBugTraqPro...

How to build 64-bit Python on OS X 10.6 -- ONLY 64 bit, no Universal nonsense

I just want to build this on my development machine -- the binary install from Python.org is still 32 bits and installing extensions (MySQLdb, for example) is driving me nuts with trying to figure out the proper flags for each and every extension. Clarification: I did NOT replace the system Python, I just installed the Python.org binary...

Why does Visual Studio use xchg ax,ax

I was looking through the disassmbly of my program (because it crashed), and noticed lots of xchg ax, ax I googled it and found out it's essentially a nop, but why does visual studio do an xchg instead of a noop? The application is a C# .NET3.5 64-bit application, compiled by visual studio ...

32 bit ActiveX Control in a 64 bit .NET App

I'm creating a C#.Net application which I want to be able to compile for "All CPUs". I also want to include a specific ActiveX control in the UI of this app, but the ActiveX control I'm trying to use does not support 32 bit. Is there some trick or work around I can use to use get this control to work? What about embedding the ActiveX c...