CS250 Lab 8: Help Everybody Get 100% on the Final

Due Wednesday, March 20

One of the pleasures in life as a humble CS professor is the invention of novel midterm and final exam questions. For the next two labs, I wish to share this with all of you! So for lab 8, create a test question about assembly, of the form "What does the following program print out". The expected answer is to write out what would appear in a terminal after the program runs, similar to question 16 on the midterm. The next lab will be to analyze everyone else's program, and write out the expected output!

Guidelines for writing a good test question: My plan is to create lab 9 as a follow-up to this, and post it just before Spring Break, with a due date after Spring Break. Next week, we'll not have a lab assignment, just project 2.

Example Question

What is printed out by the following assembly program, which runs without any error? Hint: multiple lines will be printed.
.global main
.text
main:
   mov $1, %r13
   mov $10, %r14
foo:
   add $3, %r13
   add $1, %r14
   mov $format, %rdi
   mov %r13, %rsi
   mov %r14, %rdx
   mov $0, %rax
   call printf
   cmp %r13, %r14
   jg foo
   ret
format:
   .asciz "%ld %ld\n"