Search code examples
assemblyx86nasm

what is the meaning of the label moving to register and sub?


given a a label 
L1: db "beat it",10,0
L2:


what is the meaning of:
mov eax,L2
sub eax,L1

L2 to register, and sub register from label include string


Solution

  • MOV EAX,L2 moves the address the label represents to the register.

    Unlike MOV EAX,[L2] which gets a value (the content of the memory) from that address.