Author Topic: HELP! LABEL(EA)  (Read 12687 times)

Offline hyperx

  • New Member
  • Posts: 1
HELP! LABEL(EA)
« on: December 09, 2012, 06:31:08 PM »
hi,guys.
the effective address(label) in nasm has always been confusing me.
Q1:
what is EA?  (is it relative to the start of the whole program or the start of a segment?)
Q2:
is meaning of EA in protect mode the same as that in real mode?

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: HELP! LABEL(EA)
« Reply #1 on: December 10, 2012, 12:28:18 AM »
Read NASM Manual - Section 3.3 - Effective Addresses.

Wikipedia also has a useful entry on the topic.

The best source of information, however, is right from the processor manuals provided by AMD or Intel, as they will detail the differences between valid real mode and protected mode effective addresses.

The quick and dirty explanation is: effective addresses are whatever the CPU architecture qualifies as a valid address, whether that means a combination of registers, immediate values, memory values, etc. In short, effective addresses are a means to achieve more complex memory lookups, such as ebx+edx where ebx could be the pointer to an array and edx is the offset from the beginning of the array.

A specific x86 instruction, LEA (Load Effective Address) can also be used to perform multiple calculations in one instruction and need not be related to memory address calculations.