x86

Assembly language variables

What is the assembly language variable bl? How many bits does it hold? Is it a part of a larger variable like EBX? ...

In what circumstances can large pages produce a speedup ?

Modern x86 CPUs have the ability to support larger page sizes than the legacy 4K (ie 2MB or 4MB), and there are OS facilities (Linux, Windows) to access this functionality. The Microsoft link above states large pages "increase the efficiency of the translation buffer, which can increase performance for frequently accessed memory". Whic...

How to specify execution time of x86 and PowerPC instructions?

Hello! I have to approximate execution time of PowerPC and x86 assembler code.I understand that I cannot compute exact it dependson many problems (current processor state - x86 processor dicides internal instructions in microinstructions, memory access time obtainig code from cache of from slower memory etc.). I found some information ...

How is the implicit segment register of a near pointer determined?

In section 4.3 of Intel 64® and IA-32 Architectures Software Developer's Manual. Volume 1: Basic Architecture, it says: A near pointer is a 32-bit offset ... within a segment. Near pointers are used for all memory references in a flat memory model or for references in a segmented model where the identity of the segment being accessed...

Why are there only four registers?

Why are there only four registers in the most common CPU (x86)? Wouldn't there be a huge increase in speed if more registers were added? When will more registers be added? ...

Maximum size of application memory space on 32 (x86)? 2 Gb or 1 Gb?

What amount of memory is available (theoretically) to application on 32 bit system? Different OSes? 2 or 1 Gb? thx! ...

MOV Assembly Instruction

What does this instruction do? mov (%r11,%r12,1), %edx Thanks. ...

How can I transpose an image in Assembly?

Hi everyone I'm working on a project and I need to compute something based on the rows and columns of an image. It's easy to take the bits of the rows of the image. However, to take the bits of each column I need to transpose the image so the columns become rows. I'm using a BMP picture as the input. How many rows X columns are in bmp...

Architecture in Eclipse

How can I change architecture in Eclipse from x86 to pdp11, what flags do I need, and do I need adjust cross-compiler, thanks in advance ...

Stack usage with MMX intrinsics and Microsoft C++

I have an inline assembler loop that cumulatively adds elements from an int32 data array with MMX instructions. In particular, it uses the fact that the MMX registers can accommodate 16 int32s to calculate 16 different cumulative sums in parallel. I would now like to convert this piece of code to MMX intrinsics but I am afraid that I wi...

Explanation of the disassembly of the simplest program (x86)

The following code int _main() {return 0;} Compiled using the command: gcc -s -nostdlib -nostartfiles 01-simple.c -o01-simple.exe gcc version 4.4.1 (TDM-1 mingw32) OllyDbg produced this output: Can you explain what happens here? Analysis so far: // these two seems to be an idiom: PUSH EBP // places EBP on stack MOV EBP...

"cpuid" before "rdtsc"

Sometimes I encounter code that reads TSC with rdtsc instruction, but calls cpuid right before. Why is calling cpuid necessary? I realize it may have something to do with different cores having TSC values, but what exactly happens when you call those two instructions in sequence? ...

Convert ARM instruction to i386 instruction

Is there any ARM instruction to i386 instruction Converter available? ...

NASM: Count how many bits in a 32 Bit number are set to 1.

I have a 32 Bit number and want to count know how many bits are 1. I'm thinking of this pseudocode: mov eax, [number] while(eax != 0) { div eax, 2 if(edx == 1) { ecx++; } shr eax, 1 } Is there a more efficient way? I'm using NASM on a x86 processor. (I'm just beginning with assembler, so please do not tell me to use ...

Effective optimization strategies on modern C++ compilers

I'm working on scientific code that is very performance-critical. An initial version of the code has been written and tested, and now, with profiler in hand, it's time to start shaving cycles from the hot spots. It's well-known that some optimizations, e.g. loop unrolling, are handled these days much more effectively by the compiler tha...

Why does x86 WiX installer on Vista x64 not write keys to WOW6432Node in the registry

I have an installer that writes to HKLM\Software\DroidExplorer\InstallPath. On any x86 machine it writes just fine to the expected location, on Windows XP x64 and Windows 7 x64 it also writes to the expected location, which is actually HKLM\Software\WOW6432Node\DroidExplorer\InstallPath. Later on during the install, my bootstrapper, wh...

use callback function to report stack backtrace

Assume I have the following: typedef struct { char *name; char binding; int address; } Fn_Symbol //definition of function symbol static Fn_Symbol *fnSymbols; //array of function symbols in a file statc int total; //number of symbol functions in the array and file static void PrintBacktrace(int sigum, siginfo_t ...

Accessing array in MASM

Hi guys, let's assume I've got the address of my array (passed as a pointer to the function) in esi register. How can I access a particular cell of the array? i.e: my_array[a + b * c] where c is constant. Thank you for the fast reply! Cheers ...

How can a extend memory space at 8086 up to 1 GB ???

How can a extend memory space at 8086 up to 1 GB ??? ...

CLI affect on video memory

I've decided to write my own bootloader. I've been able to set the video mode to 3 (although qemu already sets it to 3 already), and then print 'A' at the first character of the first line on the screen by directly changing video memory. [org 0x7C00] ;Address BIOS loads the bootloader into [bits 16] ;Set video mode to mode 3 mov al, 0...