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 condition PUSHOFF 1 // retrieve the value of x PUSHIMM 5 // push the value to compare x with LESS // compare x with 5 JUMPC trueblock // do statement blocks while x < 5 JUMP continue // goto next statement if cond fails trueblock: // the body of the loop PUSHOFF 1 // retrieve the 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 JUMP looplabel // goto loop condition to see // if repeating is required continue: // block of statements that follow loop 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