Segmentation fault when using printf to print a float in x86-64 Assembly (AT&T syntax) [duplicate]
This question already has answers here: How to print a single-precision float with printf (1 answer) glibc scanf Segmentation faults when called from a function that doesn’t align RSP (2 answers) Closed 3 days ago. I’m trying to write a simple x86-64 assembly program (AT&T syntax) to calculate the sum of a float array and […]
need help finding offset between esp and ebp
I am trying to understand how the offset is calculated from ebp
to esp
in 32-bit.
My understanding is that when you push
to the stack, esp
is decremented and points to a lower address, 4 bytes at a time on 32-bit. I assumed that (ebp
– 4) was right to get to a1fa1fa
since that is decrementing–but then I did (esp
+ 4 + 4 + 4 + 4) to get offset of ebp
from esp
, which was incorrect.
need help finding offset between esp and ebp
I am trying to understand how the offset is calculated from ebp
to esp
in 32-bit.
My understanding is that when you push
to the stack, esp
is decremented and points to a lower address, 4 bytes at a time on 32-bit. I assumed that (ebp
– 4) was right to get to a1fa1fa
since that is decrementing–but then I did (esp
+ 4 + 4 + 4 + 4) to get offset of ebp
from esp
, which was incorrect.
What is the result of this Assembly program?
I’m preparing for an exam where I have to find the results of x86 Assembly programs without a computer, in particular I have a problem with an example our teacher gave us:
Factorial in assembly, output not correct
section .text global _start _start: mov eax, 15 mov ebx, 1 lb: imul eax, ebx inc ebx cmp ebx,15 jl lb mov ebx, eax mov eax, 1 int 80h I am new to assembly, I have this code to calculate factorial of 15, I know exit code in ebx should be between 0 and 255 […]
Strange SBB behaviour – subtracting zero changes the destination?
I have a code in which I have:
Strange SBB behaviour – subtracting zero changes the destination?
I have a code in which I have:
segfault is emerged in x86 assembly fibonacci sequence code
fibonacci: push ebp mov ebp, esp mov ecx, eax mov eax, 1 mov ebx, 1 mov edx, 1 cmp ecx, 2 jle finale loop: mov edx, ebx mov ebx, eax add eax, edx dec ecx cmp ecx, 2 jg loop finale: ret I wanted to implement the Fibonacci sequence through x86 assembly. I pass arguments […]
i get this error trying to jump to the end point
this the procedure for the esc press to exit
i am trying to jump from this proc to the exit to stop game whenever esc is pressed. but it says that escpressed is out of range
Segmentation Fault in x86 Assembly
#include <string> #include <vector> using namespace std; int Min(int A, int B) { return A < B ? A : B; } int solution(string s) { int answer = s.length(); for (int Len = 1; Len <= s.length() / 2; Len++) { string Result = “”; string Temp = s.substr(0, Len); int Cnt = 1; […]