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

CS341L Fall 2008 Lab: Word Count Utility in Assembly, Lab Reports of Computer Architecture and Organization

Lab assignment 10 for cs341l fall 2008, where students are required to write a simplified version of the unix word count utility in assembly. The program should take a filename as an argument, print out the number of lines, words, and bytes in the file. Students are encouraged to use standard c-library functions and any type of file i/o. The assignment is due by noon on december 15, 2008, and should be submitted as an email attachment with the subject 'cs341l lab10 [last name]'.

Typology: Lab Reports

Pre 2010

Uploaded on 07/22/2009

koofers-user-o02
koofers-user-o02 🇺🇸

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download CS341L Fall 2008 Lab: Word Count Utility in Assembly and more Lab Reports Computer Architecture and Organization in PDF only on Docsity! CS341L Fall 2008 Lab Assignment #10 Week 14, 12/01/2008-12/05/2008 Word Count Purpose: Write a straight-forward simple program in assembly without having your hand held. Assignment: You are to implement a simplified version of the standard UNIX word count utility (see `man wc`). Your program should take a filename as an argument and print out n w b filename Where n is the number of lines, w is the number of words, and b is the number of bytes in the file. Note that a word is considered to be a sequence of non-whitespace character, each of which is separated by whitespace. Whitespace consists of ' ', '\n', '\t' characters. Your output should match the wc command. Some sample test files are provided in /static. Example output: barrick@shasta:/static$ wc /static/lab10_test1.txt 84 1088 6155 /static/lab10_test1.txt barrick@shasta:/static$ wc /static/lab10_test2.txt 1 9 45 /static/lab10_test2.txt barrick@shasta:/static$ wc /static/lab10_test3.txt 0 0 0 /static/lab10_test3.txt (Note that the spacing in the output isn't important, the number matching are). Your code must use PIC-code and do minimal error checking (at least abort cleanly if no file is specified). You don't explicitly need to handle the stack correctly, but you'll need to do this for using library functions anyway. You program should be written from scratch in assembly. You may use standard C-library functions as much as you like (this is encouraged), you may use any type of file I/O you like (though the mmap approach used in Lab 7 is a good approach if you don't know where else to go). You may not use assembly macros at all.
Docsity logo



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