macro's and local variables
Mischa Baars
mjbaars1977@gmail.com
Tue Oct 16 18:13:00 GMT 2012
On 10/16/2012 08:00 PM, Ian Lance Taylor wrote:
> On Mon, Oct 15, 2012 at 2:24 AM, Mischa Baars <mjbaars1977@gmail.com> wrote:
>> Who can take a look at this example code? When you look at the files
>> attached, you will see that the two different macro's give different answers
>> to the same problem.
> I don't understand. Of course the different macros give different
> answers, because the macros are different. One uses ax and one uses
> bx.
That's only because you can then see the difference in the objdump
output file.
> Also one uses i and the other uses j, and that matters because
> you are invoking them in a loop that also uses i.
This is exactly what I'm pointing at. Apart from the register naming, I
was expecting the same values to be assigned to the respective
registers. This does not happen, because 'i' is not a local but a global
value.
> You need to tell us
> what you expected to happen, and the difference between what you
> expected to happen and what actually happened.
>
> Ian
Mischa.
More information about the Binutils
mailing list