Lecture 11: Compiling to Register Machines

About Register Machines

Register machines are an alternative to compilation to stack-based machines; they are closer to modern processors.

ARM Architecture

Picture of JVM State with:

  • Procedure Stacks
  • Slots
  • Operand Stack
  • Global Heap

Register Machine Model in Scala

xyz Example using GCC and digression on computer arithmetic

Organizing the global memory:

Memory Layout for Compiled Program

We next examine how to map various data in the program to the appropriate parts of the memory.

Mapping Variables to Registers