VM_ProcessorLocalState.emitMoveRegToField(asm, VM_Entrypoints.framePointerOffset, FP);
  private static INSTRUCTION[] generateResumeThreadExecutionInstructions() {    if (VM.VerifyAssertions) VM.assert(NUM_NONVOLATILE_FPRS == 0); // assuming no NV FPRs (otherwise would have to restore them here)    VM_Assembler asm = new VM_Assembler(0);    int   ipOffset = VM.getMember("LVM_Registers;",   "ip",  "I").getOffset();    int   fpOffset = VM.getMember("LVM_Registers;",   "fp",  "I").getOffset();    int gprsOffset = VM.getMember("LVM_Registers;", "gprs", "[I").getOffset();    // T0 is previous thread    // T1 is VM_Registers for thread to be resumed    asm.emitMOV_RegDisp_Imm(T0, VM_Entrypoints.beingDispatchedOffset, 0); // previous thread's stack is nolonger in use, so it can now be dispatched on any virtual processor     asm.emitMOV_Reg_RegDisp(S0, T1, fpOffset);        // S0 := registers.fp    VM_ProcessorLocalState.emitMoveRegToField(asm,                                              VM_Entrypoints.framePointerOffset,                                              S0);    asm.emitMOV_Reg_RegDisp(S0, T1, gprsOffset);      // S0 := registers.gprs[]    asm.emitMOV_Reg_RegDisp(SP, S0, SP<<LG_WORDSIZE); // SP := registers.gprs[#SP]    asm.emitMOV_Reg_RegDisp(FP, S0, FP<<LG_WORDSIZE); // FP := registers.gprs[#FP]    // so hardware trap handler can always find it     // (opt compiler will reuse FP register)    VM_ProcessorLocalState.emitMoveRegToField(asm,                                              VM_Entrypoints.framePointerOffset,                                              FP);    for (int i=0; i<NUM_NONVOLATILE_GPRS; i++) {      asm.emitMOV_Reg_RegDisp(NONVOLATILE_GPRS[i], S0, NONVOLATILE_GPRS[i]<<LG_WORDSIZE); // i'th register := registers.gprs[i]    }    asm.emitJMP_RegDisp    (T1, ipOffset);            // return to (save) return address    return asm.getMachineCodes();  }