CSE 30 -- Lecture 2 -- Oct 2
Topics covered in class
- Two instruction sets:
- One instruction computer, and
(you should follow the link for details from the lecture)
- MIPS assembly instructions (basic load/store
instructions, arithmetic instructions, and branch instructions),
register usage convention, assembler directives, data types.
(I didn't actually get to all of this; will cover more in class Monday.)
- Examples: (one instruction computer)
Assignment 1 (due before class Wednesday, Oct 9):
You should use the turnin program to submit:
- The name of your favorite book;
- a program to multiply two numbers, in the one-instruction computer's
assembly language;
- the output of running the file
../public/assn1.asm with the
xspim program -- run xspim (you may have to type in
/home/solaris/ieng9/cs30f/public/bin/xspim), the click on the
load button to load in the assembly language file, then click
on the run button to run it. A ``console'' window will pop
up with the output of the emulated MIPS program (input is done in this
window too).
Note: your OIC program is a partial specification of what's in
memory -- you specify what memory contents are except for memory
locations 0 and 1, which will contain the inputs (call these values
x and y respectively) when the program runs; your
program's ``output'' should be the value x*y in memory
location 2. If you need to put a constant in memory as a number
instead of as an instruction, you may do so. You may use the
.data and .text notation as in the SPIM MIPS
assembler, as well as symbolic memory addresses. You may assume that
anything you put into memory as data or as instructions will not be
placed where the input values to your program will be placed.
Example notation:
# adds 2 to input in memory location 0
.data
two: .word 2 # fill entire word with the value 2
tmp: .space 1 # allocate 1 word (not bytes as in SPIM)
.text
add2: subz tmp,tmp,next # mem word gets (tmp,tmp,next) triple
subz tmp,two,next
subz tmp,0,next
subz 0,0,next
subz 0,tmp,next
You must also comment your code. You should
not use the move / add macros unless you give a very clear
description of how these macros would be implemented in a macro
assembler; if this description is unclear or has any ambiguities, I
will assume that your code does not work.
(If you've never used the turnin program before, go to a
shell window and type in help instruct for instructions on
how to use it. For this assignment, you can put everything in a single
text file. The course ID is cs30f.)
[
CSE 80 |
ACS home |
CSE home |
CSE calendar |
bsy's home page
]
bsy@cse.ucsd.edu, last updated Wed Oct 16 22:37:33 PDT 1996.
email bsy