Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

MIPS Program Assignment 2: Count Words in a Paragraph and Print in Alphabetical Order, Assignments of Computer Architecture and Organization

A mips program assignment where students are required to write a program that reads a paragraph of text, counts the number of different words, and prints them in alphabetical order. The program should ignore punctuation marks, accept all strings of letters separated by spaces as words, and assume no numerical characters. Students are encouraged to use subroutines and document their program.

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-0lh
koofers-user-0lh 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download MIPS Program Assignment 2: Count Words in a Paragraph and Print in Alphabetical Order and more Assignments Computer Architecture and Organization in PDF only on Docsity! COSC 2410 Fall 2005 Program Assignment 2 Due: 10/25/2005 Write a MIPS program that will read a paragraph of text. Count the number of different words in the text and then print out the words in alphabetical order. Requirements: 1. Declare the paragraph of English text in the data segment. You can use your own test paragraph first. The TA will use a different paragraph to test your program. The space reserved for the paragraph should be at least 1000 bytes. 2. Display the test paragraph on the console, using lines of 80 columns 3. Same words are only counted once. There will be no distinction between upper and lower cases. 4. Each word in the text is no longer than 16 bytes. 5. Ignore punctuation marks, accept all strings of letters separated by spaces as words, and assume no numerical characters. 6. Print out the words (in alphabetical order) in a column with the row number labeled. Also print out the frequency of occurrence of each word. 7. Document your program. You should use subroutines whenever possible to construction your program. Sample Input: .data InputPara: .asciiz “The buffalo is from the city of Buffalo.” WordCntMsg: .asciiz “the number of words in this paragraph:” SymbolTable: .asciiz “The word table is as following:” …… .text .globl main main: …… Sample Output: The test paragraph is: Buffalo is from the city of Buffalo. The number of words in this paragraph: 6 The word table is as following: 1 buffalo 2 2 city 1 3 from 1 4 is 1 5 of 1 6 the 2
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved