'mips printing numbers with # of bits given in input

I need to make a mips program that when given an integer, will print all possible numbers with that number of bits. What is the best was to do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source