Course contentsShow
← Computer Science
Lesson 1330 of 2,87231. Memory ManagementFree lesson

Address Binding Concepts

Learn when and how symbolic addresses in code are translated to actual memory addresses during compilation, loading, and execution.

Address Binding Concepts

You'll learn when symbolic names in your code turn into real memory addresses.

The Translation Journey

When you write code, you use symbolic names like variables (int count;) or function names (main()). But the CPU doesn't understand "count"—it needs actual numeric memory addresses like 0x4A2C. Address binding is the process of translating these symbolic addresses into physical memory addresses, and it can happen at three different times.

The Three Binding Times

Think of address binding like reserving seats at a concert:

1. Compile Time

The compiler assigns absolute addresses if it knows exactly where your program will live in memory. Like having a permanently assigned seat number before you even buy the ticket. This only works if the program always loads at the same memory location—rare in modern systems.

2. Load Time

The loader assigns addresses when your program is loaded into memory. Like getting your seat assignment when you arrive at the venue. The program is relocatable—it can load anywhere, and addresses are adjusted accordingly. Most positions are resolved here.

3. Execution Time

Addresses remain symbolic until the actual moment of use, allowing the program to move in memory during execution. Like a general admission concert where you can change seats freely. Requires hardware support (base/limit registers) and is used by modern virtual memory systems.

Why It Matters

Early binding (compile/load time) is faster but inflexible. Late binding (execution time) enables advanced features like virtual memory and dynamic relocation but requires more overhead—a classic performance vs. flexibility trade-off.

Key Takeaway: Address binding transforms symbolic names into physical addresses at compile time, load time, or execution time, with later binding offering more flexibility at the cost of runtime overhead.