pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pgubook-readers] (no subject)


From: Bryn M. Reeves
Subject: Re: [Pgubook-readers] (no subject)
Date: Thu, 23 May 2013 10:42:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

On 05/23/2013 05:28 AM, Kanish Katariya wrote:
Thank you sir for clearing my doubt.
I've one more question sir,,
Sir I'am playing around a program in which we have to find the maximum
number amog the list, but when I changed the register's from eax to ecx
or esi a segmentation error came up.
Sir what are the purposes or register's and why after changing the
register's in the whole program a error shown up?
And thanks for your support.

Depending on the instructions you are using there are restrictions in the x86 ISA that require certain operations to use certain registers.

For e.g. some 'rep' (repeat string operation) family of instructions use (E)CX as a counter and some always compare to the value in the (E)AX register.

This is non-optional and fixed in the CPU's defined behaviour so depending on the instructions and register combinations you were using the processor may have ended up operating on garbage left over in the register it expects to use for a certain instruction.

Looking at the code in question is the only way to be sure.

Regards,
Bryn.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]