COMP SCI 252 Midterm: CS 252 UW Madison Fall2014 Exam3A
Document Summary
No: book(s), note(s), or calculators of any sort. Plan your time carefully since some problems are longer than others. Use the blank sides of the exam for scratch work. The lc-3 instruction set is provided on page 9. Problem 2 (2 points: (1 point) write a single lc-3 instruction to load the number 0x4020 into r2. Assume that your instruction will be located at 0x4000: (1 point) write a single lc-3 instruction to load the data stored at memory address 0x4020 into r3. Assume that your instruction will be located at 0x4001. The table below shows lc-3 instructions starting at 0x3000, which are executed in sequence. Specify the values at memory locations 0x300f to 0x3012 after executing each instruction. Assume that the initial contents of r0 = 0x3010 and r1 = 0x3011. Also, assume that the initial values of the memory locations 0x300f to 0x3012 are all zeros. (3 points) Values at memory locations after executing the instruction.