lea(load effective adress) is used to load the offsetadress of a memory reference into a register.You should use it if you need to compute "complex"offsets.
example:;with LEAlea bx, [buffer+bp+di+02]
;without LEAmov bx, offset bufferadd bx, bpadd bx, diadd bx, 2
: lea(load effective adress) is used to load the offset: adress of a memory reference into a register.: You should use it if you need to compute "complex": offsets.
: example:: ;with LEA: lea bx, [buffer+bp+di+02]
: ;without LEA: mov bx, offset buffer: add bx, bp: add bx, di: add bx, 2
: : : i am a beginner, and i wanted to know what does lea actually : : : do and when do we use it and how.: : : thanx in advance
: : lea(load effective adress) is used to load the offset: : adress of a memory reference into a register.: : You should use it if you need to compute "complex": : offsets.
: : example:: : ;with LEA: : lea bx, [buffer+bp+di+02]
: : ;without LEA: : mov bx, offset buffer: : add bx, bp: : add bx, di: : add bx, 2
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
: do and when do we use it and how.
: thanx in advance
lea(load effective adress) is used to load the offset
adress of a memory reference into a register.
You should use it if you need to compute "complex"
offsets.
example:
;with LEA
lea bx, [buffer+bp+di+02]
;without LEA
mov bx, offset buffer
add bx, bp
add bx, di
add bx, 2
: : do and when do we use it and how.
: : thanx in advance
: lea(load effective adress) is used to load the offset
: adress of a memory reference into a register.
: You should use it if you need to compute "complex"
: offsets.
: example:
: ;with LEA
: lea bx, [buffer+bp+di+02]
: ;without LEA
: mov bx, offset buffer
: add bx, bp
: add bx, di
: add bx, 2
hmm.. do these muls and adds in LEA take the
same clock cycles as the actual instructions?
: : : i am a beginner, and i wanted to know what does lea actually
: : : do and when do we use it and how.
: : : thanx in advance
: : lea(load effective adress) is used to load the offset
: : adress of a memory reference into a register.
: : You should use it if you need to compute "complex"
: : offsets.
: : example:
: : ;with LEA
: : lea bx, [buffer+bp+di+02]
: : ;without LEA
: : mov bx, offset buffer
: : add bx, bp
: : add bx, di
: : add bx, 2