Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawing a stack frame for x86 assembly

Tags:

x86

assembly

So, I am kind of confused about drawing a stack frame for my assembly code. I have a feeling I started out wrong.

Here is what I got so far, but as you can see I am confused at step 5, because I think my initial layout is wrong.

enter image description hereenter image description here

Can you tell me where I went wrong?

like image 559
Andriy Drozdyuk Avatar asked Mar 17 '10 21:03

Andriy Drozdyuk


1 Answers

I think I'd start with a diagram that showed some (semi-)arbitrary amount of empty space at the "top" of the stack, and probably display EBP and ESP off to the left, with arrows to show where they're pointing to. I've used solid arrows for "points to" and dashed for data movement (in retrospect, it might be better to reverse that).

alt text

like image 173
Jerry Coffin Avatar answered Sep 21 '22 17:09

Jerry Coffin