I
I
Ivan G.2021-08-15 22:12:40
assembler
Ivan G., 2021-08-15 22:12:40

What does the lea (assembler) command do?

The tutorial contains the code below, and an explanation of the principle of the lea command that is extremely incomprehensible to me. Can you please explain in detail what it does using this code as an example (otherwise, the code is clear, only this command is unclear)?

assume CS:SUXXX, ES:SUXXX

SUXXX segment
org 100h

MAIN proc
  lea bp,ABC
  mov AH,13h
  mov AL,3
  xor bh,bh
  mov bl,07h
  mov cx,16d
  xor DX,DX
  int 10h 
  int 20h
MAIN endp

ABC db 'H',0Ah,'e',0Bh,'l',0Dh,'l',0Ch
    db 'o',0Bh,',',0Ah,' ',0Ah,'W',09h
    db 'o',08h,'r',07h,'l',06h,'d',05h
    db '!',02h,'!',02h,'!',02h

SUXXX ends

end MAIN

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2021-08-15
@Kozgemikin

Loads an address into the register. What's incomprehensible here?

V
VitalyChaikin, 2021-08-18
@VitalyChaikin

LEA RECEIVER, SOURCE
is the same as
MOV RECEIVER, offset SOURCE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question