What does lea in this x86-64 code do?

assembly, x86-64

Solution

`lea`, Load Effective Address, puts the computed "memory address" in the result register. So here, `rcx = rsi + 4` and `rax = rsi + 0x14`.

By the way, the second line doesn't really look like it's part of the code that sets up the stack frame, `rsi` is the second argument when using System V AMD64 calling conventions.

Problem

These are the first four lines of a function. I know that the first two lines create a new frame in the stack and are basically 'setup' lines. What do the lea instructions do? ``` 40148e: 48 83 ec 18 sub $0x18,%rsp 401492: 48 89 f2 mov %rsi,%rdx 401495: 48 8d 4e 04 lea 0x4(%rsi),%rcx 401499: 48 8d 46 14 lea 0x14(%rsi),%rax ```

Original source

Related problems