allocate-registers one, jump allocate-registers n, result ; Initialize a register with the constant 1 li one, 1 ; Read n from input, and initialize result to 1 read n li result, 1 compute: ; If n is zero, then we are done li jump, done jeqz n, jump ; Otherwise, update result and n, then loop mul result, result, n sub n, n, one li jump, compute j jump done: ; Report result and halt write result halt