RB
unread,Jul 7, 2010, 11:03:54 AM7/7/10You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I am not experience in assembler, but sometimes I attempt to
do (or study ) things that I can only see thru assembler. So
I have the following that I would like comments on from using
the inline assembler of MS VC 6.x
-----------------------------------------------------------------
__asm // delete afer experiment
{ // Question 1 is mov reg, ebp-4 Legal ?
push eax // save eax
mov eax, ebp-4 // MS compiler makes this, mov eax, ebp, it drops the minus 4, evidently the ebp-4
// is not allowed. Anyhow the addr of 12FF80h (which is the addr held in ebp) gets
// moved to eax.
mov eax, [ebp-4] // this moves a copy of the value (0012FEA1h) held in addr (12FF7Ch) of ebp-4 into eax.
push [ebp-4] // this pushes the value (0012FEA1h) into the current addr of esp (12ff14h)
// Question 2 is push ebp-4 Legal?
push ebp-4 // this disassembles to, push ebp , it does not appear to do anything since the
// value (0012FEA1h) was already sitting at the current addr of esp (12ff10h) and
// nothing changed. The address ptd to by ebp-4 was 12FF7Ch at the time.
pop eax
pop eax
pop eax // restore eax
}