//----------------------------------------------------// // Generic template for program // //----------------------------------------------------// // start building stack at address 0: PUSHIMM 0 // save current FBR; FBR starts at zero: PUSHFBR // need to push 1 for FBR; why? // the main method is the first function, which // means building a new frame PUSHIMM 1 POPFBR // store FBR value in the *register* // run code inside main function: JSR main // restore the FBR to the previous value POPFBR // Exit the program, leaving just the return // value on the stack: STOP // code for all other functions, starting with main main: remainingstuff