Page 1 of 1

what did i miss about ebp?

Posted: Sat Jan 26, 2008 10:33 am
by sancho1980
hi

i have a routine with a variable number of parameters
the number of parameters passed to the routine is fetched from within the routine via:

Code: Select all

mov([ebp+8],eax);
i.e., its the last parameter pushed

this still works fine. but then im trying to process the "real" parameters in a loop by loading ebp+12 into ebx and then adding 4 to ebx in each cycle. here i noticed the following strange behaviour:

Code: Select all

mov(ebp,ebx);
putunsint([ebp+12]);
putunsint([ebx+12]);
putunsint displays an unsigned integer as the name suggests...

the first putunsint statement shows me the correct value, i.,e. the value that i want to see
the second putunsint shows me something different! how can this be if ebp and ebx contain the same value (putunsint DOES preserve the ebx register!)

any clues?

thanks

martin

Posted: Sat Jan 26, 2008 10:41 am
by sancho1980
sorry for the stupid question

i had completely forgotten that i had loaded ss with a completely different segment than ds :-)