Department of Electrical and Computer Engineering
University of Texas at Austin
EE 379K
Fall 2000
Y. N. Patt, Instructor
TAs: Kathy Buchheit, Laura Funderburg, Chandresh Jain, Onur Mutlu, Danny Nold, Kameswar Subramanian, Francis Tseng, Brian Ward

Programming Assignment 2
Due: October 22, 2000 11.59 PM

Reversing a bit pattern in memory

Problem Statement

You are asked to write a program in LC-2 machine language that takes a word stored at memory location x3100 and reverse all the bits. You will store your result in memory location x3300. Example: If the bit pattern 1010100101001011 is stored at memory location x3100, your program should write the bit pattern 1101001010010101 into memory location x3300.

Hint: As you know from programming assignment 1, ADDing a bit pattern to itself effectively shifts the bit pattern to the left by one bit position. If I have a number X and I AND it with the bit pattern 0000000000000001, what do I get? What do I get when I AND the same number with 0000000000000010?

Notes and Suggestions

What to Turn In

You will submit your program electronically. You can find instruction on how to submit your program in a document titled "How to submit your programs" that is linked from the course homepage.

If you wrote your program in hex, you may submit your .hex file in a similar manner. You will receive a response by email to your ECE account. Make sure to check the email response to see if it was received on time. The email you will receive contains a lot of information about your program, including a copy of your program. Please read the entire email and make sure that you can see your program in the email. If you cannot see your program in the email, we will not be able to see it either.

Note: You must submit your program by following the steps above. You may NOT email your program to your TA.