MIPS Calling Convention for CS64

Outline

  1. Preface
  2. Motivation
  3. Key Instructions and Transferring Control Flow
  4. Arguments
  5. Return Values
  6. Functions that Need Additional Registers
  7. Functions that Call Functions
  8. Functions that Call Functions Which Need Additional Registers
  9. Mapping Variables to Registers
  10. Invariants to Preserve

Preface

This document discusses the calling convention which we will be using in CS64, which defines the protocol used for calling functions and returning from functions. Many different such calling conventions exist, and this document merely describes one of them. For those interested, this document’s calling convention is based off of the calling convention here.

Relative to other calling conventions, the calling convention in this document is simplified. Specifically, this calling convention: