int q, r, s; // 4 bytes each double amount = 0; // 8 bytes // COMPILED: q does not map to 50000 // q maps to BASE + 100 for ( int i = 1 ; i <= 100 ; i++ ) { amount += i; } e.g. 6502 A X Y ----------------- LDA #0 STA BASE + 120 ;amount LDX #1 L: LDA BASE + 120 ;amount STX BASE + 128 ;temp ADD BASE + 128 ;amount+temp STA BASE + 120 ;amount INX CPX #101 BNE L ; BNE -40 Dynamic Loading: -- less memory usage; more efficient -- beneficial when large amounts of code are required to handle infrequent cases Dynamic Linking: -- better memory utilization -- standardization of libraries Contiguous Memory Allocation --------------------------------- Fixed-size partitions: -- BAD: Unused memory - internal fragmentation -- GOOD: Relatively easy to maintain: # Size Mem addr Status 1 200K 100K P6 2 150K 300K P5 ... 5 50K 850K Free First-fit allocation -- OS (memory manager) maintains free/busy lists organized by memory locations (low-order memory to high-order memory)