0: LDC 5,106(0) ;; set the status pointer 1: LD 1,1(0) ;; grab command-line arg 2: ST 1,-1(5) ;; ... and place in LOC 105 * ------------------ ------------------------------------- 3: LD 1,-1(5) ;; n is at LOC 105 4: LDC 2,10(0) ;; we need 10 in a register 5: SUB 3,1,2 ;; now we can compare r3 to 0 and branch 6: JGE 3,3(7) ;; select inverted Jxx instruction * ;; and branch over the then clause * then clause * 7: LDC 4,1(0) ;; load value of the then clause into r4 8: ST 4,10(5) ;; store r4 into memory slot for t4 9: LDA 7,4(7) ;; and branch over else clause * * else clause * 10: LD 1,-1(5) ;; reload n from LOC 105 11: LD 2,-1(5) ;; reload n from LOC 105 12: MUL 4,1,2 ;; compute value of else clause into r4 13: ST 4,10(5) ;; store r4 into memory slot for t4 * ------------------ ------------------------------------- 14: OUT 4,0,0 ;; ... or [next instruction] 15: HALT 0,0,0 ;;