Exam I - INEL 4206 - Fall 2009

Exam I - INEL 4206 - Fall 2009 - Exam I - INEL 4206 - Fall...

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

View Full Document Right Arrow Icon
Name: _______________________ INEL 4206 Exam I Fall 2009 September 29, 2009 Open book and notes. Only the text copies, instruction sheet handout, slide printouts and your own notes may be used. In the interests of originality and creativity please turn off all electronic communication devices including celulares, laptops, and pocket computing devices. 1. Describe and program a MIPS program equivalent to the C program t1 = 1; s1=45; t2=10; while{ t1 < s1) t1 = t1 * t1; t2 = t2 – 1; s1 = s1 * t2 *(t1 – t2) + 1; } Assume t1, etc. will be in registers$ t1, etc. and s1 is in $s1 and do need to be initialized. You may need temporary registers. Describe and program this loop in MIPS assembler (you do not need the .text and .data, etc., you only need to show the code fragment. Please place your description here – this should include a description (it takes one short sentence) of what the program calculates The program begins with the initialized definitions of t1, etc. The while loop, while t1<s1 starts with a label, again, followed by a test to see if t1<s1. If not, the loop is ended by a jump to a label done. The body of the loop is a straightforward translation of the three expressions to assembly; the longer expression takes a temporary to hold t1-t2 and several expressions And your code here. .text
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

Exam I - INEL 4206 - Fall 2009 - Exam I - INEL 4206 - Fall...

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

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