CS/COE 447 Spring 2010 Information for Exam 1 ======================== You can bring the green card (or a copy of it) with you. No calculators, computers, etc. The exam will focus on chapter 2, and what we covered in lecture (in the slides and on the board) through Wednesday 2/17. It will also cover Labs 1-5, Homework 1, and Programming Assignment 1. For the exam, you won't be responsible for knowing pseudo-ops or instructions that are not on page 1 of the green card. Also, the use of the stack will not be covered on this exam. A sample exam and solution are available on the class schedule. PLEASE NOTE: not everything can be on the exam, and obviously yours will be different. So, be sure to work on everything, not just the examples on the sample exam (e.g., be sure you can give the machine code for all of the instructions we've covered). Here are the sections in the text covered by Exam 1: Chapter 1 1.1 Introduction 1.2 Below Your Program Chapter 2 2.1 Introduction 2.2 Operations of the Computer Hardware 2.3 Operands of the Computer Hardware 2.5 Representing Instructions in the Computer 2.6 Logical Operations 2.7 Instructions for Making Decisions 2.8 Supporting Procedures in Computer Hardware (only basics of calls/returns; nothing about stack) 2.10 MIPS Addressing for 32-Bit Immediates and Addresses Appendix B B.43 Little vs. Big Endian B.44-B.73 MIPS Instructions (only those we've covered) === All of the questions on the exam will be one of the following types: Translate: a decimal number to binary a binary number to decimal a binary number to hex a hex number to binary a hex number to decimal (we'll keep this reasonable, given that you won't have a calculator) Give the machine code for a given assembly language instruction. Given a segment of assembly-language code, trace its execution by showing what values are placed in memory and in registers Given a short segment of C code (such as those given in the lecture notes, labs, and chapter 2), write assembly-language code that does the same thing. (e.g., for loops, while loops, if-then-else statements). The C code will be explained -- we aren't assuming that everyone has programmed in C before. Write a subroutine to accomplish something, and call it from the main program Allocate data in main memory (using, e.g., .data, .word, .byte) Given something from the Green Card written in Verilog (e.g., in the OPERATION column or one of the footnotes), give what this means for a specific instructions. This will only about instructions we have covered so far in the course. === Hints for studying Make sure you understand all of the given code. Step through code in the simulator, predicting which values will go where, and then check yourself. Make sure you understand the contents of memory the simulator shows you, and also the entries in the symbol table. Calculate the machine code for the given assembly language instructions, checking your answers in the simulator. Write samples of if-statements, loops, and check yourself by stepping through your code in the simulator.