public int allocateSpaceForSysCall(int n){
  int bytes=n * WORDSIZE;
  if (sysCallOffset == 0) {
    sysCallOffset=allocateOnStackFrame(bytes);
  }
  return sysCallOffset;
}

public int allocateSpaceForSysCall ( int n ) { int bytes = n * WORDSIZE ; if ( sysCallOffset == 0 ) { sysCallOffset = allocateOnStackFrame ( bytes ) ; } return sysCallOffset ; }
we will have to save and restore all non - volatile registers around system calls , to protect ourselves from malicious native code that may bash these registers . call this routine before register allocation in order to allocate space on the stack frame to store these registers .
