x86

Sql Server x64 and x86 Linked Server

I have a Visual FoxPro table that I need to access from Sql Server. In Sql Server x86, I would just create a linked server. Unfortunately, there is no x64 driver for VFP - so Sql Server x64 can't create a linked server to it. So far, I've come up with following options - none of which I'm particularly fond of: Set up an x86 Sql Server...

Return from interrupts in x86

I have loaded an idt table with 256 entries, all pointing to similar handlers: for exceptions 8 and 10-14, push the exception number (these exceptions push an error code automatically) for the others, push a "dummy" error code and the exception number; then jump to a common handler So when the common handler enters, the stack is prop...

Linux cross-compilation for ARM architecture

I am interested in cross-compile a Linux kernel for an ARM target on a x86 host. There are some good practices you recommend? Which is the best cross-compile suite in your opinion? Have you setted up a custom cross-compile environment? If yes, what advices you have? Is it a good idea? Thanks, Myrrdyn ...

Why are there extra instructions in my gcc output?

GCC compiles (using gcc --omit-frame-pointer -s): int the_answer() { return 42; } into .Text .globl _the_answer _the_answer: subl $12, %esp movl $42, %eax addl $12, %esp ret .subsections_via_symbols What is the '$12' constant doing here, and what is the '%esp' register?...

[gcc generated assembly] .comm?

I just translated this program, #include <stdio.h> int dam[1000][1000]; int main (int argc, const char * argv[]) { // insert code here... printf("Hello, World!\n"); return 0; } to assembly using gcc producing, .cstring LC0: .ascii "Hello, World!\0" .text .globl _main _main: pushl %ebp movl %esp, %eb...

meaning of x86 assembler instruction

Can someone please explain what the following x86 assembler instruction does? call dword ptr ds:[00923030h] It's an indirect call I suspect but exactly how does it compute the address to call? Thanks Marek ...

Trouble examining byte code in MSVC++

I've been messing around with the free Digital Mars Compiler at work (naughty I know), and created some code to inspect compiled functions and look at the byte code for learning purposes, seeing if I can learn anything valuable from how the compiler builds its functions. However, recreating the same method in MSVC++ has failed miserably ...

A Simple Assembly Input Question

This is my first post on this site. I am taking an X86 assembly class and I am having a bit of trouble with my second project. The project is very simple. The program needs to take in a simple string from the user and display it back. I have gotten the program to take input from the user but I can't seem to store it. Here is what I have ...

x86 assember - illegal opcode 0xff /7 under Windows

Hi overflowers I'm currently developing an x86 disassembler, and I started disassembling a win32 PE file. Most of the disassembled code looks good, however there are some occurences of the illegal 0xff /7 opcode (/7 means reg=111, 0xff is the opcode group inc/dec/call/callf/jmp/jmpf/push/illegal with operand r/m 16/32). The first guess ...

Can someone explain this directly assembled x86 JMP opcode?

At school we have been using a bootstrap program to run stand-alone programs without an operating system. I have been studying this program and when protected mode is enabled there is a far jump executed by directly assembling the opcode and operands as data within the program. This was for the GNU assembler: /* this code imme...

How to perform low-level IO with a USB flash drive under the BIOS (compared to a floppy)?

I have recently been studying some bootstrap code which was intended for use with a floppy drive. My goal is to modify the program so that it uses my USB flash drive. Now I see how the INT 13H function has been used with the floppy device, but I guess my question is, how will communicating with the USB drive differ? For example, here is...

MASM32 Memory Locations

I am attempting to read from main memory using masm32 assembly and in order to do this I created (as previously recommended in an answer to another of my questions here) an array that will contain the greatly separated memory locations (in order to avoid reading from cache). I have managed to create the array and have it being read, how...

Can I force cache coherency on a multicore x86 CPU?

The other week, I wrote a little thread class and a one-way message pipe to allow communication between threads (two pipes per thread, obviously, for bidirectional communication). Everything worked fine on my Athlon 64 X2, but I was wondering if I'd run into any problems if both threads were looking at the same variable and the local ca...

How to require x86 up the .NET dependency chain when building

We have several projects that use p4.net, a managed DLL, which in turn is dependent on p4dn.dll, a 32-bit unmanaged DLL. This has problems on x64 systems, so I have had to go to each project that uses p4.net and set its processor type to x86. If I understand the problem right, it's that when .NET loads an exe, it checks for a manifest a...

Can a 32bit process access more memory on a 64bit windows OS?

From what I understand, a 32bit process can only access 2GB of memory on 32bit windows without the /3GB switch, and that some of that memory is taken up by the OS for its own diabolical reasons. This seems to mesh with my experiences as we have an app that crashes when it reaches around 1.2 - 1.5 GB of RAM with out of memory exceptions,...

What is your favourite anti-debugging trick?

At my previous employer we used a third party component which basically was just a DLL and a header file. That particular module handled printing in Win32. However, the company that made the component went bankcrupt so I couldn't report a bug I'd found. So I decided to fix the bug myself and launched the debugger. I was surprised to fin...

Drain the instruction pipeline of Intel Core 2 Duo?

I'm writing some micro-benchmarking code for some very short operations in C. For example, one thing I'm measuring is how many cycles are needed to call an empty function depending on the number of arguments passed. Currently, I'm timing using an RDTSC instruction before and after each operation to get the CPU's cycle count. However, I...

What is the purpose of the frame pointer?

I'm a beginner in assembly language and have noticed that the x86 code emitted by compilers usually keeps the frame pointer around even in release/optimized mode, when it could use the EBP register for something else. I undertand why the frame pointer might make code easier to debug, and might be necessary if alloca() is called within a...

How can I best pass a Global Offset Table (GOT) for my language on x86?

I'm writing a small program loader for my language because I gave up on understanding ELF format (and while doing this, I may eventually understand it better). I mmap the files on the memory and tux rejoices whatever.. I don't want to hinder the sharing of the program by doing any changes on it. Therefore I end up doing the same as C an...

Possible to trap write to address (x86 - linux)

I want to be able to detect when a write to memory address occurs -- for example by setting a callback attached to an interrupt. Does anyone know how? I'd like to be able to do this at runtime (possibly gdb has this feature, but my particular application causes gdb to crash). ...