How does this work exactly? I know that lea is efficient compared to using add/mov instructions because it doesn’t go through the ALU or set any flags. So how is lea getting its addresses? What makes it better than add/mov?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The LEA instruction uses the effective address (EA) part of the CPU to do certain kinds of arithmetic without using the ALU. The EA module can do very specific kinds of arithmetic that is used for address calculation, but can also be used for other things if what you need is one of the things it specifically provides.
By not using the ALU for this EA calculation, the ALU can be busy doing something else at the same time and you can avoid a pipeline stall.