andrew mendonca 0 Junior Poster in Training

For this programming exercise, you may use ONLY these instructions:

and nor or ori sll srl xor

Run the programs by verifying the value of the PC is 0x00400000 (right-click the field and use Change Register Contents to set it) and then single stepping (pushing F10) and observing the results in the QtSpim register display window.

Start a program with the instruction that puts a single one-bit into the low order bit of register eight ($8 or $t0):
ori $t0, $0, 0x01

Now, by using only shift logical instructions and register to register logic instructions (use NO more immediate instructions), put the pattern 0xAAAAAAAA into register $9 (or $t1). You may not use another andi, ori or xori instruction to set another bit from scratch, you must work from the single bit you set in the first instruction or created directly from that bit. You will need to use more registers than just $9. See how few instructions you need to do this. Doing this in approximately ten to twelve instructions is reasonable. It can be done in fewer. Again, you MAY NOT create any other data bits from scratch for this, only the single bit you started with.

This is my first time learning assembly language programming. Can I please get help in getting started on this program?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.