2015/assembly-roulette

From CS61
Jump to: navigation, search

Learning Objectives

  • Comfort with readings assembly generated in the wild
  • Ability to handle whatever Dr. Evil throws at you in your Bomb

Getting Started

There is no code for today's exercises!

Instead, you will see that there is a number on your bucket. The number corresponds to a Google doc that has been prepared for you. Go to the class folder and select the document for your table.

Now, team up in pairs and have each pair select a color.

Once you've got your team and a color, each team should work on their appliance and write a C function that is not too long - perhaps 10 lines. You will generate assembly that you'll paste into the Google doc and this will become a puzzle for the other teams at your table. Be thoughtful about the C you write -- you want to generate something that is approachable, but challenging. You can decide what optimization level to use to produce the code you post, but unless the others at your table demand it, let's stay away from vectorized instructions -- we could spend an entire couple of lectures learning those and we're not going to do that. Try not to spend more than 5-10 minutes generating your puzzle (we'll alert you after about 10 minutes).

Once each team has generated some assembly, start working on the assembly generated by the team to your left. See if you can work your way all the way around the table; if you do, then everyone gets to write a new C function. If groups get stuck, it's the other groups' job to help them get unstuck. Feel free

If there are constructs you found particularly fun, clever, interesting, or challenging, annotate them on your Google doc (after all the teams have had a chance to try all the functions).

Wrapping Up

We'll take a few minute to ask tables if they have any particularly fun code samples to share.

And, as always, take a minute and complete the post-class survey.

Enjoy!