programming_exam2_practice - ECE 190 Midterm Exam 2 Spring...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 ECE 190 Midterm Exam 2 Spring 2011 Practice Exam Notes: Programming part of the exam will consist of three problems. Each problem will be graded separately. We will provide skeleton codes for each problem. Problem 1 (10 points): Warm-up. After reading the MP3 handout Kirti discovered that the 16 x 16 "Life" board was not big enough to hold the extremely fun PULSAR pattern. Sam was so disappointed in our failure that he has asked you to write the new gold code for the CALC_ADDR routine. Implement a subroutine that multiplies an input by 17 using only 5 non-looping/branching instructions, then adds x5000 and R1. Inputs: R0, R1 (will always be between 0 and 16, no need to do a modulus or any other looping operation to ensure the input is in range) Outputs: R2 = 17 * R1 + R0 + x5000 Description: Callee saves all registers (does not count against 5 instruction limit). Uses 5 non-looping instructions to perform a mult. by 17. The table starts at x5000 Use the following skeleton code is provided to get you started: ; “main” function .ORIG x3000 AND R0, R0, #0 ADD R1, R0, #4 ; R1 <- 4 as an example ADD R0, R0, #5 ; R0 <- 5 as an example JSR CALC_ADDR HALT ; CALC_ADDR ; your code starts here RET ; end of CALC_ADDR function ; any data fields to be allocated here ; .END
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Problem 2 (5 points): Debugging. This program is given a 200x200 matrix of cells, one cell per memory location starting at x5000
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2012 for the course ECE 190 taught by Professor Hutchinson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 6

programming_exam2_practice - ECE 190 Midterm Exam 2 Spring...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online