Lecture 006

Application Binary Interface (ABI)

Application Binary Interface: designer choice to layout memory, control function calls, and passing data.

Stack

Bottom: Highest address Top: Lowest address

pushq src:

Function Call

Passing Control

call label:

ret:

Data Flow

When having more than 6 arguments:

Manage Local Data

Frame: Function Call

Stack Frame

Stack Frame

Caller, Callee Saved

Caller-Saved

Caller-Saved

Callee-Saved

Callee-Saved

Common Questions

Will function over-allocate stack? as passing 7th 8th argument? (looks like there is a 8 bit gap above 8th argument)

Behavior of movl, movq. mov $0x4030d8,%esi does it assume equal size? so 0x4030d8 will be padded with 0s?

if a function call is a tail call, does C do optimization to stack allocation in recursion?

Why do assembly generate nop (see in assembly, not 0x00)

Why don't we mov %rbp %rsp in 64 bit

Why would caller want to save r10 and r11 that are not arguments to callee? (they are caller-saved but not arguments)

what is rep; ret

Why would mov 0x0, %eax before function call? has to do with vector?

Table of Content