int   ipOffset = VM_Entrypoints.registersIPField.getOffsetAsInt(); int   fpOffset = VM_Entrypoints.registersFPField.getOffsetAsInt(); int gprsOffset = VM_Entrypoints.registersGPRsField.getOffsetAsInt();
  private static VM_CodeArray generateRestoreHardwareExceptionStateInstructions() {    VM_Assembler asm = new VM_Assembler(0);    int   ipOffset = VM_Entrypoints.registersIPField.getOffsetAsInt();    int   fpOffset = VM_Entrypoints.registersFPField.getOffsetAsInt();    int gprsOffset = VM_Entrypoints.registersGPRsField.getOffsetAsInt();    // Set PR.framePointer to be registers.fp    asm.emitMOV_Reg_RegDisp(S0, T0, fpOffset);     VM_ProcessorLocalState.emitMoveRegToField(asm,                                              VM_Entrypoints.framePointerField.getOffsetAsInt(),                                              S0);    // Restore SP    asm.emitMOV_Reg_RegDisp (S0, T0, gprsOffset);    asm.emitMOV_Reg_RegDisp (SP, S0, SP<<LG_WORDSIZE);        // Push registers.ip to stack (now that SP has been restored)    asm.emitPUSH_RegDisp(T0, ipOffset);    // Restore the GPRs except for S0, PR, and SP     // (restored above and then modified by pushing registers.ip!)    for (byte i= 0; i < NUM_GPRS; i++) {      if (i != S0 && i != ESI && i != SP) {        asm.emitMOV_Reg_RegDisp(i, S0, i<<LG_WORDSIZE);      }    }        // Restore S0    asm.emitMOV_Reg_RegDisp(S0, S0, S0<<LG_WORDSIZE);    // Return to registers.ip (popping stack)    asm.emitRET();    return asm.getMachineCodes();  }