Skip to main content

Questions tagged [x86]

x86 is an architecture derived from the Intel 8086 CPU. The x86 family includes the 32-bit IA-32 and 64-bit x86-64 architectures, as well as legacy 16-bit architectures. Questions about the latter should be tagged [x86-16] and/or [emu8086]. Use the [x86-64] tag if your question is specific to 64-bit x86-64. For the x86 FPU, use the tag [x87]. For SSE1/2/3/4 / AVX* also use [sse], and any of [avx] / [avx2] / [avx512] that apply

x86
-2 votes
0 answers
47 views

function call crash on amd

I made a exe and a dll. Dll calling function in exe. it is fine in intel system but it is crash when amd system. asm { push ebp -> crash here most of the time mov esp,ebp -> crash here rarely ...
Yoyoyo345's user avatar
4 votes
0 answers
87 views

Run time depends on code after the measured part

Consider the following C++23 program (online). #include <chrono> #include <cstdio> #include <print> constexpr size_t NWrites = 10000000000; #define DEST_STORAGE static #define ...
Dr. Gut's user avatar
  • 2,713
0 votes
0 answers
44 views

Why is my array value not equal to a literal?

I am new to assembly and was trying to work with an array. However, I was geting caught when try to compare the array value to a constant stored in a register. From the following code I was expecting ...
Jeremy's user avatar
  • 1
1 vote
0 answers
18 views

the Perf event issues of hardware prefetcher (all_pf_data_rd and pf_l2_data_rd)

My platform is 2nd generation scalable Xeon, equipped with a non-inclusive cache. I run a series of tests that had the L2 stream prefetcher aggressively prefetching. I use Perf to monitor performance, ...
grayxu's user avatar
  • 132
-1 votes
0 answers
46 views

How does SYSCALL save the userspace RSP?

On a x86 CPU running in long mode, how is the user-mode $RSP value saved after the SYSCALL instruction by the kernel's handler function? When changing from user mode (CPL=3) to kernel mode (CPL=0), ...
quixotrykd's user avatar
4 votes
1 answer
158 views

Understanding the flow of the kernel upon receiving a SIGSEGV for null-dereference

I'm trying to figure out the sequence of things that occur inside the Linux kernel (x86_64, v6.9) when we write these two codes: // Null-dereference + writing to page zero *(char *)0 = 0; // Null-...
Iman Seyed's user avatar
1 vote
1 answer
54 views

gnu inline assembly constraint `i` for memory address

Recetly, this function rip_rel_ptr has been added to Linux kernel. https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/asm.h#L118. I can compile the kernel, but when I copy this ...
amrzar's user avatar
  • 365
-5 votes
0 answers
82 views

x86 mulss result is diffrent over time [closed]

I am trying to make C++ neural network library and I noticed, that sometimes model with same inputs and same parameter values drastically changes output for no reason. I have no idea why it happens, ...
ZDibLO's user avatar
  • 5
1 vote
1 answer
33 views

REX encoding for instructions with the VEX prefix

[x64] is there some generic algorithm using which I can determine relevant registers for the rex byte? I'm specifically interested in the calculation of REX for instructions with the VEX prefix (so ...
Goubermouche's user avatar
4 votes
0 answers
60 views

Why does Intel x86 manual use +rd instead of +ro or +rq for 64-bit registers?

The description of the PUSH instruction in the Intel manual (PDF, Volume 2, Chapter 4.3, PUSH) contains the line 50+rd PUSH r64. It seems +rd is used throughout most of the instruction descriptions ...
user2468852's user avatar
1 vote
0 answers
31 views

Link function calls against reverse engineered binary

I created an windows x86 .exe file that I reverse engineer. Imagine I only have the .exe file and I reverse engineered some functions. The goal is to create a dll that links with this .exe so the dll ...
Edward Gynt's user avatar
1 vote
1 answer
50 views

My bootloader isn't printing after switching to Protected Mode

I'm trying to print the character "C" after switching to the Protected Mode, but it isn't working, and I don't know why. I'm using Assembly AT&T/GAS syntax Here is the code: .code16 ....
user avatar
1 vote
1 answer
90 views

Why do I get multiple ASM instructions per addition? (Visual Studio 2022 Community)

Here's the C program, I use Visual Studio Community 2022 with MSVC compiler. What are all those mov instructions, I don't use any compiler optimization flags. #include <stdio.h> int main(void) {...
CupOfGreenTea's user avatar
0 votes
1 answer
36 views

x86 NASM Crash - Iterate over string

How to iterate over individual characters of a string in x86 assembly and print them? global _main ; declare _main entry point extern _printf ; extern method section ....
OutOfBrainExcepction's user avatar
22 votes
2 answers
1k views

How to prepare stack pointer for bare metal Rust?

I'm trying to write an x86 bootloader and operating system completely in Rust (no separate assembly files, only inline assembly within Rust). My bootloader works completely as intended within the QEMU ...
suman's user avatar
  • 325

15 30 50 per page
1
2 3 4 5
1163