main:    PUSHIMM 0    // return slot for main and program
         ADDSP 2      // allocate 2 local vars
         PUSHIMM 10   // push 10
         STOREOFF 1   // store val 10 in address 1 (x<-10)
         PUSHIMM 20   // push 20
         STOREOFF 2   // store val 20 in address 1 (y<-20)
         PUSHIMM 0    // allocate return value for add
         PUSHOFF 1    // push value of x for p1
         PUSHOFF 2    // push value of y for p2
         LINK         // save old FBR (0) and update FBR (6)
         JSR add      // jump to function "add"
         UNLINK       // restore FBR after returning from "add"
         ADDSP -2     // pop parameters (p1, p2) of "add"
         JUMP mainEnd // prepare to end main
mainEnd: STOREOFF 0   // store program’s rv
         ADDSP -2     // remove x,y
         STOP         // end program
add:     PUSHOFF -2   // get p1
         PUSHOFF -1   // get p2
         ADD          // push x+y
         JUMP addEnd  // begin to end add
addEnd:  STOREOFF -3 // store x+y as rv
         RST          // return to main