CPSC 323: Object Code Generation

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

8 Terms

1
New cards

Object Code Generation

  • Compiler phase where intermediate code (typically three-address code, 3AC) is translated into the machine/assembly language of a specific target architecture. It bridges the gap between abstract, high-level program representation and concrete, executable instructions

  • Goal: Produce correct, efficient, and minimal assembly that respects hardware constraints, especially the very limited number of registers available on real machines.


2
New cards

How does object code generation avoid redundancy?

Naive translation emits many loads/stores that are never actually needed.

3
New cards
4
New cards

Goals of Object Code Generation

  • Correctness

  • Minimal Instructions

  • Efficient Register Use

  • Minimize Memory Traffic

  • Preserve Semantics

  • Portability(Target Constranints)


5
New cards

Challenges in Object Code Generation

  • Limited CPU registers

  • Frequent loads and stores

  • Selecting efficient instructions

  • Handling temporaries

  • Balancing correctness and performance

  • Target diversity


6
New cards

Target Machine Model

  • Simple abstract machine for studying code generation



7
New cards

Memory ←→ Register

  • One of the families of instructions a generator emits


8
New cards

R1 =

4R2