Skip to content
Advertisement

Tag: x86-64

Running 32-bit code in 64-bit process on Linux – memory access

I’m experimenting with running 32-bit code inside a 64-bit Linux process. The 32-bit code is completely self-contained, it makes direct IA32 system calls on its own. If I were to load this code in a 32-bit process, it would run just fine. Initially, I thought I could just allocate a stack for the 32-bit code, switch to it and everything

SSE: unaligned load and store that crosses page boundary

I read somewhere that before performing unaligned load or store next to page boundary (e.g. using _mm_loadu_si128 / _mm_storeu_si128 intrinsics), code should first check if whole vector (in this case 16 bytes) belongs to the same page, and switch to non-vector instructions if not. I understand that this is needed to prevent coredump if next page does not belong to

Calling Assembly code from C++

I’m trying to write my own I/O library, so the first step is just being able to output a character. So far, this only needs to work on Linux. I wrote what I believe to be a solid _putc: label in x86 (with Intel syntax), and I put it in “io.h”, then called it from my main file, “test.cpp”. Here’s

Why doesn’t the ‘syscall’ instruction work under Linux?

I have a very basic assembly program that runs in Linux userland: However, this doesn’t work as it is, but only if I replace the syscalls with int 0x80. Don’t these do the same thing? I know that syscall was designed to be lower-latency, but other than that, I didn’t think there was a difference. Why doesn’t it work? Answer

Advertisement