CSE 410 HOMEWORK POLICY Spring 2003 Homeworks will be given out each Thursday normally, and will be due the following Thursday in class. Late homeworks will not be accepted. _________________________________________________________________________ HOMEWORK #1 Due: Thursday April 10 1a.Take the following machine language code and rewrite it in assembly language. Assume that the instructions are stored in sequential locations, starting at address 100. 1 1 1 2 3 1 1 3 2 1 1 2 5 1 1 2 4 1 1 1 8 1 0 7 7 1 0 0 1 1 1 2 4 1 1 3 2 1 1 2 0 1 2 3 0 0 7 9 0 0 0 1 0 0 0 1 b. What does the program do? 2a. Write an assembly language program to compute the greatest common divisor (gcd) of two positive integers m and n. (The gcd is the largest integer that evenly divides both m and n. Thus, gcd(20,8)=4, gcd(7,25)=1, gcd(9,27)=9 ) Use the following variation of Euclid's algorithm: x = m; y = n; while (x != y) { if (x > y) x = x - y; else y = y - x; }; // x = y = gcd(m,n) b. Assemble your program into machine language, starting at location 537.