Lab 7: Machine Code

Goals:

        By the conclusion of this lab period, you will have:

  1. Learned about how instructions are stored in MIPS.
  2. Practiced binary and hexadecimal number conversions.
  3. Learned about how data is stored in MIPS.


Machine Code (Instructions)

  1. Download the file Lab7.s to your machine and open it in PCSpim.  Also download the file MachineCode.doc to your machine and open it in Word.


  2. Find the address and machine code for each of the MIPS instructions. Write these in hexadecimal in the third and fourth columns of the first table, respectively.


  3. Change each of the machine code instructions to binary and write these binary values in the last column of the first table but using the following format. Alternate the style of each group of four bits between bold and normal face. Break the bit string into fields corresponding to the type of instruction by putting 2 spaces between adjacent fields.


  4. Except for the jump instruction, convert each group of bit strings to decimal and use the second table to display these values but do the following. For an instruction that does not have 7 fields, merge the appropriate cells of the table before writing the decimal values for the instruction. For a jump instruction, give the target address in hexadecimal.


Machine Code (Data)

  1. Find the location of the data within PCSpim.  Using the third table, fill in the various values requested.  Use formatting similar to that which you used in the previous tables.


  2. The values for the String may seem odd.  Do some research and learn why.  [A hint is found here.
  3. ]  Explain what the intuitive answer might have been, how the actual answer differed, and why this was the case in a paragraph at the bottom of the file you have been editing.

Hand In

  1. You are to print out the edited version of the MachineCode.doc file that contains your answer.  Be sure that it includes your name(s).  No cover sheet is necessary this week.

Due Date

     This lab is due by 4 p.m. on Monday, October 15.

Help Policy

       Help Policy in Effect for This Assignment: Group Project With Limited Collaboration

       In particular, you may discuss the assignment and concepts related to the assignment with the following persons, in addition to an instructor in this course: any Computer Science instructor and any student enrolled in CS 231.

       You may use the following materials produced by other students: materials produced by member of your own group.