CS 341 Assignment #1 Due Thursday 02/04/99 PART 1 ------ Reading Assignment: Chapter 2 of the lab manual. PART 2 ------ Carry out the following tasks to get familiar with and able to use the TKISEM Simulator. 0) Make links to the TKISEM files on your CIRT account. 1) Assemble and link a sample program. For example, you might use "add.s" which is in "~brayer/341/Examples" on the CIRT AIX systems. 2) Start up tkisem. 3) Step through program/examine registers. 4) Examine memory (User Data). 5) Set a breakpoint (in User Text). Please note this will be a VERY IMPORTANT skill to have for debugging later in the semester. There is nothing to turn in from part Part 1. PART 3 ------ For each of the following statements, write, assemble, and test a SPARC assembly language program that implements the statement. Be certain to declare and initialize variables in your assembly language programs. (i) a = -((a+b) - 5 - d) (ii) a = 8765 - c (iii) a = 90000 - c (iV) f(i) = f(i-1) + f(i-2), 2<= i<= 5 and f(0)=0 and f(1)=1. The programs should be well-commented with an informative header included (a comment per line is not excessive). Blank lines should be used to separate the program into logical sections. This enhances readability. See the file add.s for an example of what's expected. Variable names must correspond precisely to the variable names as they appear in the exercises in the lab manual; no extra variables should be introduced. Variables (a, c, etc.) correspond to locations in memory, allocated in the data segment. The grader must be able to blindly replace your data segment with his own (which corresponds to defining a variable with a different initial value) and have the program run correctly. The source must be turned in by e-mail only by 02/04/99 to the following address: robyn@unm.edu REQUIREMENTS FOR ASSIGNMENT 1: 1) Turn in by e-mail (1 file). 2) Each SPARC program must use the same variable as in the assignment. (see add.s) 3) Must compile (i.e. assemble and load) 4) Must be correct. 5) Must be well-commented. a) A header b) A short comment per line c) spacing used to divide a program into its logical units d) Good use of TABs for horizontal spacing. e) See add.s This is an easy assignment, but generally it is a bad idea to wait to the last minute to write your programs. The assignments may appear deceptively simple but since they have to be carried out in assembly language they can turn out to be difficult. Errors can be more time consuming to locate and correct.