This just came in earlier today. Given that the program is due in a few hours, I decided to deal with it immediately.

     Prof Patt,  I was wondering why these instructions won't
     multiply like they're supposed to.

             add   r2,r1,0; r1=a,b,or c,r2=counter,r3=result
       loop  add   r3,r1,r1
             add   r2,r2,-1
             BRnp  loop

     it multiplies once then keeps on outputing the same result.  
     what am I doing wrong?

     << name withheld to protect one whose instructions refuse to
     do what they are supposed to >>

I guess I could answer his question in fewer than ten words. Probably most of you can. But that would defeat the whole purpose of having the student learn for himself.

So, I would rather tell him to assemble the program and single step it with the simulator. After each instruction, look at the contents of each register. That is called: tracing the program. My hope is that after he has executed seven or ten instructions, he will see immediately "why these instructions won't multiply like they're supposed to."

That is the problem with computers. They do what you you tell them to do, not what you think they are supposed to do.

Yale Patt