Wednesday 8 February 2017

X86 INSTRUCTIONS:::DATA TRANSFER INSTRUCTION:::6-LOAD EFFECTIVE ADDRESS

Load Effective Address : Syntax : lea src, dest #GAS Syntax lea dest, src #Intel syntax The lea instruction calculates the address of the src operand and loads it into the dest operand. Operands src Immediate Register Memory dest Register Modified flags No FLAGS are modified by this instruction Load Effective Address calculates its src operand in the same way as the mov instruction does, but rather than loading the contents of that address into the dest operand, it loads the address itself. lea can be used not only for calculating addresses, but also general-purpose unsigned integer arithmetic (with the caveat and possible advantage that FLAGS are unmodified). This can be quite powerful, since the src operand can take up to 4 parameters: base register, index register, scalar multiplier and displacement, e.g. [eax + edx*4 -4] (Intel syntax) or -4(%eax, %edx, 4) (GAS syntax). The scalar multiplier is limited to constant values 1, 2, 4, or 8 for byte, word, double word or quad word offsets respectively. This by itself allows for multiplication of a general register by constant values 2, 3, 4, 5, 8 and 9, as shown below (using NASM syntax): Example : lea ebx, [ebx*2] ; Multiply ebx by 2 lea ebx, [ebx*8+ebx] ; Multiply ebx by 9, which totals ebx*18

No comments:

Post a Comment

"Exploring the Intersections: Insights into Exam Prep, Science, Business,Tech,Web-dev,Admin&Health

काबिज नजूल : आबादी भूमि पर बने मकान को विक्रय करते समय बिक्रीनामा तैयार करने की प्रक्रिया-Occupied Nazul or populated land

काबिज नजूल अथवा आबादी भूमि पर बने मकान को विक्रय करते समय बिक्रीनामा तैयार करने की प्रक्रिया:   1. दस्तावेज इकट्ठा करना: विक्रेता और खरीदार ...