How to: (0) Get a list of the few instruction types that will be covered in the exam: There will be a midterm question on decoding and executing some MIPS machine language instructions. The instructions that may appear are: Those in InstrExamples.txt (lecture slide source), plus ADDIU, SUB AND,XOR,OR,NOR ANDI,XORI,ORI (whoops, there's no SUBI in MIPS!) Tables to decode the instructions and a brief MIPS Instruction set architecture summary will be supplied with the exam. (1) Get MIPS instructions and data to type in to your cpu simulator: Different ways to use the samples here: (a) Look at the .s files and assemble by hand. Tedious but you are expected to know how to do it. Practice it a few times and then use tools described below. (b) Use spim (from csi333) (c) From a test case in this directory, such as t01-syscall, Run "gmake t01-syscall.od" This prints a hexadecimal listing of the t01-syscall.boot (Observe the command constructed by gmake on the Makefile.) You can print this listing on paper and use it to help you simulate the memory. To capture the listing in a file (so you can print it), use "gmake t01-syscall.od > ~/myprinting/t01-syscall.od" ( > means redirect standard output to the named file) (d) From a test case in this directory, such as t01-syscall, Look at the assembly language source (t01-syscall.s) Run "gmake t01-syscall.disasm" from this directory (Observe the command constructed by gmake on the Makefile.) (e) From a test case in this directory, such as t01-syscall, Run "402loadelf t01-syscall.bootELF" (f) Learn to use the -R option of mips-elf-as Different ways to use your own testcases: (a-b) Same as above. (c-e) Copy the contents of this directory into your own subdirectory. Create new assembly language files, say mytest.s Follow the instructions (c) or (d) above For (e), run "gmake mytest.boot" first. (2) Use the mips-elf-cc, mips-elf-objdump, mips-elf-as, etc commands: Give the following command from the ~csi402/pub/Project2 directory: source 402projsetup.cmd (this prepends the directory containing these mips-elf-* commands to your shell's PATH environment variable, and also prepends to MANPATH) Follow the examples or directions from course assignments, emitted by the Makefile, or read the documentation of gcc, as and binutils (3) How to get the 512 byte "bootfiles" for the --boot-record option of the cpu: (a) Copy or reference the .boot files in this directory. Study the corresponding .s or .c source files. (b) Copy the contents of this directory to your own test case directory, to generate say t01-syscall.boot, run gmake t01-syscall.boot (c) Write your own MIPS assembly language or C (not C++, use no libraries) source file, say mytest.c, and run gmake mytest.boot (4) How to get ELF files for Parts 4 and 5: Follow instructions of (3) except use say gmake t01-syscall instead of gmake t01-syscall.boot The ELF file will be named t01-syscall (This follows unix tradition that executable files have no name suffix. Under Unix, you CAN use a suffix of your choice if you like.)