x86

D function using the x86 CMPXCHG Compare-and-swap

I'm looking for a function that presents a high level D interface to an atomic CAS on Intel x86. I know I can do it with inline ASM (and if needed I will), but I'd rather just grab code from someone else if I can. ...

Unmanaged x64 assemblies in mixed .NET development environment

What do we do if we have some devs working on 64 bit machines and some on 32 bit machines, but we need to reference unmanaged assemblies that need to be in x86 for half the team and x64 for the other half? Is there a solution besides manually updating the references every time someone on a 64 bit rig gets latest? ...

Android: Is there a PC port?

Is it possible to have Android running on x86 computers? ...

Which x86 assembler do you use?

For anyone who works with x86 assembly, I'm curious which assembler you use. Preferably, the name should be an acronym and end in "ASM" =) ...

Copying and calling Functions in x86 AT&T-Assembler in gcc

I wrote the following code in AT&T Assembler Syntax for gcc .global main .section .data to_gen_inner: #x f, implicit n pushl %ebp movl %esp, %ebp movl $0xFF00FF00, %eax call printregs lret .set to_gen_inner_len, . - to_gen_inner .section .text main: pushl %ebp movl %esp, %ebp ...

What mode for .NET Application on Windows 2008 64 bits

How will my .NET application run under Windows 2008 x64? As a 32 bit application or as a 64 bit? Does that make any difference? ...

Floating point rounding when truncating

This is probably a question for an x86 FPU expert: I am trying to write a function which generates a random floating point value in the range [min,max]. The problem is that my generator algorithm (the floating-point Mersenne Twister, if you're curious) only returns values in the range [1,2) - ie, I want an inclusive upper bound, but my...

Does x86 have an atomic increment that keeps the value that was stored?

I have found lock inc addr but that doesn't keep a copy of the stored value around and even a read immediately after it in the same thread could come after a competing write. The best solution I have found is a load/inc/cas loop. ...

How does the processor handle conditions?

So, SUPER low-level what does an IF() look like, how is it handled by an x86 processor? ...

dword ptr usage confusion

In assembly language if we use mov eax, dword ptr[ebx] then it means copy the value pointed by ebx (ebx contains the address value, not the actual value, this instruction copies the actual value in the address)? If we use mov eax, dword ptr[some_variable] then it means copy the value of variable "some_variable" itself to eax, not ...

Learning x86 asm on linux

Duplicate What is a Good x86 Assembly Book? Could someone point me to a book/tutorial which is best for x86 asm on linux. I know there are threads that exist for this already, and probably some books even. ...

Why does Nant driven MsBuild compile to different directory on different machines?

I wrote a Nant script that executes MSBUILD.exe to compile a project on my dev machine. On my dev machine, the projects builds its output to bin\x86\Release and my Nant script zips up the contents of that directory. I then commit everything to SVN and let TeamCity run the Nant script that executes MSBUILD.exe to compile the project and z...

What is the best way to learn x86 assembly on a Linux platform?

I have no prior knowledge of assembly programming, and would like to learn how to code x86 assembly on a Linux platform. However, I'm having a hard time finding a good resource to teach myself with. The Art of Assembly book looks good, but it teaches HLA. I'm not interested in having to learn one way, then relearning it all over again. ...

What are some good x86 assembly language resources?

What are some good online resources (references, books, tutorials, documentation, etc) for learning and programming in assembly language (more specifically nasm)? It seems as though some of assembly language is rather arcane and I sometimes have problems finding any good info on it. ...

Why is printf showing -1.#IND for FPTAN results?

I am working on a program which produces assembler code from expressions. One of the functions required is tan(x) which currently works using the following sequence of code (the addresses are filled in at run time): fld [0x00C01288]; fld st(0); fsin; fld st(1); fcos; fdivp; fst [0x0030FA8C]; However, I would like to use the FPTAN opco...

GCC Inline Assembly: Jump to label outside block

When using inline assembly under MSVC, one is allowed to jump outside of the assembly block by referencing a label in the C/C++ code, as explained in this MSDN article. Can such thing be done when using inline assembly under GCC? Here's an example of what I'm trying to accomplish: __asm__ __volatile__ ( " /* assembly code */ " " j...

What are some ways you can manage large-scale assembly language projects?

At my university the Assembly Programming (x86 and MIPs) class is drawing to an end. I've thoroughly enjoyed my work in assembly and I would really like to continue working with it. You would think that having to do everything myself would be a drag but I have found that there is a level of transparency that I don't get with higher le...

Representation of wchar_t and char in WinDbg

Note: /* * Trivial code */ wchar_t *greeting = L"Hello World!"; char *greeting_ = "Hello World!"; WinDbg: 0:000> ?? greeting wchar_t * 0x00415810 "Hello World!" 0:000> ?? greeting_ char * 0x00415800 "Hello World!" 0:000> db 0x00415800 00415800 48 65 6c 6c 6f 20 57 6f-72 6c 64 21 00 00 00 00 Hello World!.... 00415810 48 00 65 00 6...

Differences between x86/x64/ia64 memory models on .NET

I'm looking for a reference on the differences between the memory models used by the .NET CLR/JIT on x86/x64/ia64. I know there's some differences between x86 and ia64 (instruction reordering, instruction removal, etc.), but I haven't found a reference on the differences between x86 and x64. I have an application that is aiming for s...

How do I identify device specific interrupts on x86?

In the Intel software developers manual it says that interrupt vectors 32-255 are usually user defined for external IO devices. In my systems programming class I must develop a simple device driver. My question is how can I define a specific interrupt vector to be used for a specific device? Is this done with the BIOS? Note: we are deve...