ADDSP 2 // leave space for x and rv PUSHIMM 1 // push 1 on the stack STOREOFF 1 // store the value 1 for x looplabel: // label the loop starting at the "do" PUSHOFF 1 // retrieve the current value of x PUSHIMM 1 // push 1 onto the stack ADD // add 1 to the current value of x STOREOFF 1 // store the new value of x PUSHOFF 1 // retrieve the new value of x PUSHIMM 5 // the value x is compared to (5) LESS // compare x JUMPC looplabel // repeat loop if comparison succeeded PUSHOFF 1 // push the current value of x STOREOFF 0 // store current value of x to return ADDSP -1 // adjust the SP to return x STOP // stop the program