Difference between revisions of "CSC231 Final Exam Fall 2017"

From dftwiki3
Jump to: navigation, search
Line 15: Line 15:
 
* Make a copy of it under the name 231Lib2.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.  See below for an example.
 
* 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.  See below for an example.
* The message can be at most 80 characters, and at least 1 character in length, and will be printed on one ine only.   The Linux '''cowsay''' command wraps long messages but you are not supposed to implement this feature.
+
* The message can be at most 80 characters, and at least 1 character in length, and will be printed on one ine only.
 +
* Use the Linux '''cowsay''' command to see examples of outputs (/usr/games/cowsay your message).
 +
<br />
 
::<source lang="text">
 
::<source lang="text">
 
cs231a@aurora ~ $ /usr/games/cowsay Hello CSC231
 
cs231a@aurora ~ $ /usr/games/cowsay Hello CSC231
Line 21: Line 23:
 
< Hello CSC231 >
 
< Hello CSC231 >
 
  --------------
 
  --------------
        \  ^__^
 
        \  (oo)\_______
 
            (__)\      )\/\
 
                ||----w |
 
                ||    ||
 
cs231a@aurora ~ $ /usr/games/cowsay Good luck with the exams
 
__________________________
 
< Good luck with the exams >
 
--------------------------
 
 
         \  ^__^
 
         \  ^__^
 
         \  (oo)\_______
 
         \  (oo)\_______
Line 36: Line 29:
 
                 ||    ||
 
                 ||    ||
 
cs231a@aurora ~ $  
 
cs231a@aurora ~ $  
 +
 +
</source>
 +
* You should get the same output as shown above if you do this in your test program:
 +
<br />
 +
::<source lang="asm">
 +
Hello db "Hello CSC231"
 +
HelloLen equ $-Hello
 +
 +
 +
mov ecx, Hello
 +
mov edx, HelloLen
 +
call _printCow
 +
 
</source>
 
</source>
 +
<br />
 
* Your function should not modify any of the registers.
 
* Your function should not modify any of the registers.
 
* You are allowed to add other functions to your 231Lib2.asm file.
 
* You are allowed to add other functions to your 231Lib2.asm file.

Revision as of 14:24, 12 December 2017


...