230-F09-Assign1

230-F09-Assign1 - 6. Calculate the value of $s0 - $s1 + $s2...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE/EEE 230 Assignment 1 Fall 2009 Due September 8, 2009 (11:59PM) This assignment is designed to introduce you to the MIPS assembly language, using registers and memory, input/output syscalls and the MIPS simulator (PCSpim). a. Open a text editor (such as Notepad or Textpad) and type in the following. Save your file as assign1.s .data a:: .word 0 b: .word 0 c: .word 0 .globl main .text main: b. Add zero terminated ascii strings for the following output strings 1. Your name 2. “Enter a number “ 3. A new line (end of line) c. Add the MIPS assembly language instructions to the end of the file (after the main) to complete the following (in this order). Note that the variables a, b, and c addresses or locations in memory in the data segment. Use other registers if needed. Actions: 1. Initialize the register $s0 to 13 2. Prompt the user to enter a number, read the number into register $s1 3. Prompt the user to enter a number, read the number into register $s2 4. Store the value in $s1 into the memory labeled “a” 5. Store the value in $s2 into the memory labeled “b”
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6. Calculate the value of $s0 - $s1 + $s2 and store the result in the memory labeled c 7. Print the following output each on its own line a. Your name b. The value in a c. The value in b d. The value in c 8. Exchange or swap the values in $s1 and $s2 9. set the value in $s0 to $s0 Specifics: Use only the instructions covered to date. Your programs will end when it runs out of instructions this is expected. Test, test, test!!!!! Documentation: Comment the beginning of your programs with your name, class, and assignment number. Comment every instruction. Assignment 1 submittal: Upload your assembly language program (.s file) using the link on the website. Click on the submit button. Remember you can only submit once. Do not use the digital dropbox or other methods. Note: Blackboard often has a problem with Firefox so you may need to use IE for your browser....
View Full Document

Page1 / 2

230-F09-Assign1 - 6. Calculate the value of $s0 - $s1 + $s2...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online