# LEA Instruction

Loads an effective address into an address register. LEA is often used when writing code that must be independent of the position in the memory (which all Fargo programs are). It's often used with the address methods x(PC) or x(PC,xr.s).
LEA also adds a constant to an address register without changing the flags, and/or also an index with x(An,xr.s).
ADDRESS METHODS: (An), x(An), x(An,xr.s), x.w, x.l, x(PC), x(PC,xr.s)
DATA LENGTH: Longword
FLAGS: Unaffected
SYNTAX: LEA <ea>,An

EXAMPLE CODE:

LEA memorylocation,A1 *loads the address of a memory location into A1. This is commonly used in the trap statement when you are outputting strings to the screen