CSE410 HOMEWORK #3 Due: Thursday, April 24 1. Q. 3.19 on page 203 of PH. This question requires that you read pages 201-202. Do NOT use their C code. Instead, write equivalent assembly language programs for the following C code: a = b * c; b = a + c; c = b / (b - d); 2. Assume a two-address machine with four 32-bit general-purpose registers and a full complement of 32-bit shifting and logical operations, such as rshift, lshift, and, or, and not. (a) Give a sequence of assembly language instructions that will store bits 7, 8, 9, and 10 of a register R3 into the 4 low order bits of a register R4, zeroing out the remainder of R4. (b) Write a sequence of assembly language instructions that will store the 4 low order bits of R5 into bits 7, 8, 9, and 10 of R3, leaving the remainder of R3 intact and not changing R5. 3. Consider again the greatest common divisor gcd(m,n) of two positive integers m and n, defined as gcd(m,n) = if m=n then m else if m>n then gcd(m-n,n) else gcd(m,n-m) (a) Write a *recursive* function in some higher-level language, such as C, C++, C#, or Java,that computes gcd(m,n). Use at least one local variable in your function, even though this might not be necessary. (b) Suppose that your function is implemented using a stack, stack pointer register (sp), and frame pointer register (fp), as discussed in class. Consider the call: x = gcd(14,8); Show the contents of the stack and the pointer registers at *each* call of gcd, starting with gcd(14,8), and after the first *two* returns from your function.