CSCI 2321 (Principles of Computer Design):
Sample Programs
MIPS assembler programs
- "Starter" program for testing code fragments in
the simulator:
starter.s.
- Demo code from class (1/22):
class-01-22.s.
- Example of simple procedure call (1/29):
call-addproc.s.
- "Hello world" program (1/31):
hello.s.
- Program to get and echo a line of text (1/31):
echo.s.
- Program to get and echo an integer (2/07):
echoint.s.
- Program to compute and print factorial using recursion (2/07):
fac.s.
- Program illustrating procedure with (some) pointer parameters (2/21):
divide.s.
- Program to get and echo a float (2/21):
echofloat.s.
- Program to compute square root using Newton's method (2/21):
newton.s.
- Program to count digits in a line of text (2/26):
countdigits.s.
- Program to say whether line of text is a palindrome (not in class):
palindrome.s.
- Files for assemble/link example (2/21):
asm-link-1.s,
asm-link-2.s.
Notes showing working through the steps:
asm-link.pdf.
C programs
Other files
- Script to mail files for homework submission
mail-files.
Instructions for usage
here.