Difference between revisions of "CSC231 Final Exam Fall 2017"

From dftwiki3
Jump to: navigation, search
Line 1: Line 1:
 
<onlydft>
 
<onlydft>
  
=Assembly=
+
=Problem 1:  Assembly=
* Add a new function to 231Lib.asm called cowPrint() that gets a message in ecx, edx, and prints a message with a cow, as does the bash  
+
* Get a fresh copy of 231Lib.asm..
 +
* Make a copy of it under the name 231Lib2.asm
 +
* Add a new function to 231Lib2.asm called _cowPrint() that gets a message in ecx, edx (similarly to _printString), and that prints a message with a cow, similarly to the bash command cowsay.
 
::<source lang="text">
 
::<source lang="text">
 +
 +
/usr/games/cowsay That\'s all folks\!
 
  ___________________
 
  ___________________
 
< That's all folks! >
 
< That's all folks! >
Line 25: Line 29:
  
 
</source>
 
</source>
 +
<br />
 +
==Submission==
 +
<br />
 +
You need to submit 231Lib2.asm on Moodle.    It will be tested with a separate main program.
 +
<br />
 +
 +
=Problem 2: C function=
 +
<br />
 +
Write a C function called zap2() that will work similarly to the zap() function of Homework 9, but will replace '''all''' occurrences of the second string in the first string.
 +
 +
For example, zap2( "Mississippi", "ss" ) will return "Mi--i--ppi".
 +
 +
Store you
  
 
* Have file of ints, and put together a bash file that reads 10 integers, these are indexes of lines to get in the file.
 
* Have file of ints, and put together a bash file that reads 10 integers, these are indexes of lines to get in the file.

Revision as of 14:53, 10 December 2017


...