   0 ;; fac n :
   0 ;;  if n <= 0 return 1
   0 ;;  else return n * fac n - 1
   0 
   0 ;; main :  a = fac 3
   0 
   0 ;; let r1 = a
   0 ;; let r2 = input n, r3 = output retvalue
   0 ;; let r4 = link, r5 = sp
   0 
   0 .s
   0 	sp 5
   0 	link 4
   0 	a 100
   0 .a 0
   0 .c 
   0 :main
   0   ld sp #200  ;; initialise sp
   1   ld r2 #3
   2   jal link fac
   3   st a r3
   4   trap stop r0
   5 
   5 :fac
   5   ;; let t1 = n to do 
   5   ;; n * fac n - 1  is
   5   ;; t1 = n
   5   ;; n = n - 1
   5   ;; retvalue = call fac
   5   ;; retvalue = t1 * retvalue
   5   ;; save locals : r6 = t1
   5   st @1 sp link  ;; push link
   6   st @2 sp r6  ;; push t1
   7   add sp sp #2
   8   sub r0 r2 r0 ;; n <= 0 ?
   9   jmp GT else
  10   ld r3 #1
  11   jmp always ret
  12 :else
  12   or r6 r2 r0 ;; t1 = n
  13   sub r2 r2 #1 ;; n - 1
  14   jal link fac
  15   mul r3 r6 r3 ;; n * fac n - 1
  16 :ret
  16   ;; restore
  16   ld r6 @0 sp  ;; pop t1
  17   ld link @-1 sp ;; pop link
  18   sub sp sp #2
  19   jr link
  20 .e
