CS326 Homework #10

CS326 Homework #10 - When the last integer is input the...

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

View Full Document Right Arrow Icon
CS 326/508 Computer Organization and Design Spring 2012 Homework #10 Due: May 2, 2012 The document entitled “System Call Codes.pdf” posted in the Course Documents folder on Blackboard explains how basic I/O is accomplished in MIPS. Read this document so that you can use the information to complete this assignment. An example program named “Console IO Subroutine.asm” is provided in the Course Documents folder on Blackboard that demonstrates the programming for using Console I/O, subroutines and the stack in memory. This program is documented throughout with comments explaining what the program is doing. This program can be opened and run in the MARS software and you should do this in preparation for completing the assignment. Currently, the program when run, prompts the user to enter five integers (words) via the console interface. As each integer is input, it is read and placed (pushed) onto the stack in memory.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: When the last integer is input, the program then reads the integer values from the stack (pops) and prints them to the console. You should note that the integers are displayed in reverse order from that entered. This is because the stack is a last-in first-out (LIFO) data structure. For this assignment, modify the program so that instead of handling integers, it works with characters. In other words, accept characters (a, b, c) instead of integers (1, 2, 3). Make all necessary changes to the program so that the characters are correctly read from the console as input, pushed on and popped off the stack, and printed on the console. Turn in: 1. Printed copy of your program. 2. Screen print of the MARS window showing the stack and console. See next page....
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern