What does this instruction do?

Thread Solved

Join Date: Jun 2008
Posts: 10
Reputation: SirDorius is an unknown quantity at this point 
Solved Threads: 1
SirDorius SirDorius is offline Offline
Newbie Poster

What does this instruction do?

 
0
  #1
Jun 10th, 2008
Hello all! I'm new here

I was looking through a program and I was wondering what this instruction is:
  1. LEA EAX,DWORD PTR SS:[EBP-34]
I know that LEA moves the offset of the second argument into EAX but I don't understand the segund argument very much:
  1. DWORD PTR SS:[EBP-34]
I'm guessing it's a pointer to a double word located in [EBP-34], but what does the SS stand for (no nazi jokes :p)?

And besides, what's the point in moving the offset of a pointer? Couldn't it just move the pointer directly, since it has the same size, and it wouldn't have to dereference it again afterwards
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 6,577
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 848
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: What does this instruction do?

 
0
  #2
Jun 10th, 2008
SS means stack segment.

EBP typically moves around with ESP (BP=Base Pointer, SP=Stack Pointer).

The BP is typically used to establish a fixed point of reference for a stack frame. BP + offset would typically be parameters, BP - offset would be local variables and temporary storage.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
--
If your code lacks code tags, you will be IGNORED
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 10
Reputation: SirDorius is an unknown quantity at this point 
Solved Threads: 1
SirDorius SirDorius is offline Offline
Newbie Poster

Re: What does this instruction do?

 
0
  #3
Jun 11th, 2008
Ok thanks a lot!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 1317 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Assembly
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC