Linked Questions

3 votes
0 answers
2k views

"-fomit-frame-pointer" means the way we don't have to pushq %rbp and move %rsp, %rbp; we need to only change the value of %rsp. As far as i think, stack frame dealing with the base pointer ...
주혜민's user avatar
0 votes
1 answer
225 views

I have the following code: #include <x86intrin.h> int main() { return __rdtsc(); } And I tried to compile on my machine (Intel i7-6700 CPU) and objdump g++ -Wall test_tsc.cpp -o test_tsc -...
HCSF's user avatar
  • 2,711
0 votes
0 answers
166 views

I'm trying to understand how a function call works in assembly language. My understanding is, after calling a function, the callee function first uses a function prologue to create a new stack frame ...
user45698746's user avatar
128 votes
7 answers
48k views

I'm trying to get a deeper understanding of how the low level operations of programming languages work and especially how they interact with the OS/CPU. I've probably read every answer in every stack/...
Christoph's user avatar
  • 28.5k
65 votes
2 answers
81k views

According to Intel, in x64, the following registers are called general-purpose registers (RAX, RBX, RCX, RDX, RBP, RSI, RDI, RSP and R8-R15). In the article Understanding C by learning assembly, it's ...
Dennis's user avatar
  • 1,085
9 votes
2 answers
3k views

My question is simple, Why do x86 architecture use two stack registers (esp ; ebp)? The length of stack frame has been determined during compile time, then I think we can just use one register (for ...
lllllllllllll's user avatar
7 votes
2 answers
2k views

I read that the dynamic link points to the previous activation record ( aka a "stack frame"), so it makes sense in dynamic scoped programming language. But in static scoped programming ...
Yuval Simon's user avatar
1 vote
1 answer
2k views

While investigating a crash, I came across the following code snippet and immediately recognized that the mov instruction should actually be movq to get the correct 64-bit register operation. #elif ...
Chappelle's user avatar
5 votes
2 answers
1k views

I've made a function to calculate the length of a C string (I'm trying to beat clang's optimizer using -O3). I'm running macOS. _string_length1: push rbp mov rbp, rsp xor rax, rax .body: ...
SpilledMango's user avatar
1 vote
5 answers
2k views

When it comes to temporarily storage for an existing value in a register, all modern compilers(at least the ones I experienced) do PUSH and POP instructions. But why not store the data in another ...
J.Smith's user avatar
  • 111
1 vote
1 answer
2k views

During a recent project, I've tested combinations of different compiler flags and sanitizers to evaluate the relevance for debugging my C-code. By testing the impact of these combinations, I stumbled ...
Emanuel Schmidt's user avatar
8 votes
1 answer
2k views

I have a function void X(Object o) { .... } When I compile it, I see, that clang changes its signature to void X(Object* o) It is inconvenient, because I use this function from some llvm IR code ...
Necto's user avatar
  • 2,682
1 vote
3 answers
1k views

why does this code: #include "stdio.h" int main(void) { puts("Hello, World!"); } decide to initialize a stack frame? Here is the assembly code: .LC0: .string "Hello, World!" main: ...
Riolku's user avatar
  • 722
1 vote
2 answers
2k views

I'm trying to explore the debugging of an assembly code (x86, 32bit, C source code). I would like to understand how can I calculate the actual size of the stack frame of particular function in my ...
zzoorrii's user avatar
0 votes
1 answer
314 views

Update: If it helps narrow down the question for anyone, this question is really more about the CPython API and whether or not I'm missing some way to reach information that I need. I'm not asking ...
Iguananaut's user avatar
  • 23.8k

15 30 50 per page