CMPSC 64 Chapter Notes - Chapter A: Call Stack, Spim, Data Segment
Document Summary
Register use = procedure call conventions = a software governing the use of registers by procedures. Register sh always contains the hardwired value 0. Registers (1), (26), and (27) are reserved for the assembler and operating systems and should not be used by user programs or compilers. Registers - (4-7) are used to pass the first four arguments to routines (remaining arguments are passed on the stack) Registers and (2, 3) are used to return values from functions. Registers - (18-15, 24, 25) are caller-saved registers that are used to hold temporary quantities that need not be preserved across calls. Caller-saved register = a register saved by the routine being called. Registers - (16-23) are callee-saved registers that hold long-lived values that should be preserved across calls. Callee=saved register = a register saved by the routine making a procedure call.