Difference between revisions of "CSC231 Homework 1 2010"
(Created page with '<center> <font size="+2">Page under construction!</font> <br \>300px </center> <tanbox> This assignment is due on Wednesday, Sept. 22, at 11:59 p.…') |
(→Problem #1) |
||
Line 44: | Line 44: | ||
* The purpose of measuring the total size of the executable is to get a sense of the trade-off that exists when writing program between the amount of code versus the amount of data. In general, trying to make one of them simpler or shorter requires making the other longer, or more complex. | * The purpose of measuring the total size of the executable is to get a sense of the trade-off that exists when writing program between the amount of code versus the amount of data. In general, trying to make one of them simpler or shorter requires making the other longer, or more complex. | ||
+ | |||
+ | ===Submission== | ||
+ | |||
+ | * When your program is debugged, generates the correct output, contains the file size in the header, and is well documented otherwise, submit it as follows: | ||
+ | |||
+ | submit hw1 hw1a.asm | ||
+ | |||
+ | |||
+ | =Problem #2= |
Revision as of 19:30, 15 September 2010
This assignment is due on Wednesday, Sept. 22, at 11:59 p.m. + 1 minute. Programs submitted passed the deadline will not be collected or graded.
You can work on this assignment individually or in a group of two. If you decide to work in pair, make sure you have read the very good article on Pair Programming. If you work in pair, you only need to submit one program for each question. Make sure both the name of both programmers appear in the header of the script.
Contents
Problem #1
- Write an assembly language program that outputs this series of characters.
abcdefghiklmnopqrstuvwxyz abcdefghiklmnopqrstuvw abcdefghiklmnopqrst abcdefghiklmnopq abcdefghiklmn abcdefghik abcdefg abcd a
- We haven't seen loops yet. Loops are a complex concept to master. Do not attempt to use loops, even though your programmer's intuition might want you to try it. :-)
- For this Problem, create a single string that is the whole list of characters above, all 9 lines of it, and print it as a block. In other words, you will have only 1 block of 4 instructions of the type mov eac, ____, mov ebx,____, mov ecx,___, and mov edx,____.
- Store your program in a file called hw1a.asm. Assemble, link and run your program. Verify that it works well.
- Measure the size of the executable file hw1a as follows.
echo `ls -l hw1a | cut -d' ' -f 5` bytes
- You should see something of the form:
1234 bytes
- Include this number in the header of your program, as the size of its executable.
- The purpose of measuring the total size of the executable is to get a sense of the trade-off that exists when writing program between the amount of code versus the amount of data. In general, trying to make one of them simpler or shorter requires making the other longer, or more complex.
=Submission
- When your program is debugged, generates the correct output, contains the file size in the header, and is well documented otherwise, submit it as follows:
submit hw1 hw1a.asm