Homework 3
As you are aware, we have lab assignments due every week. We also will
have several homework assignments this semester, and this is one of them.
While the labs are directed, the homework assignments present larger problems
that you should break down into smaller problems. You should spend some
time thinking about and planning your homework solutions before coding
them.
Program Description
In this assignment, you are to create an assembly language program that
compiles with nasm on SNOWBALL, and runs.
We have seen how to perform input and output in assembly. Refer to the
recent lab on I/O.
In this homework, you will expand on the input/output by making a
program that filters out non-printable
ASCII characters.
That is, any character in the input from decimal 32 (space) up to 126 (tilde)
should be copied to the output. Also copy to the output the characters
at decimal values 9 and 10 (tab and line-feed). Any other character should
not be copied to the output.
Try this on multiple inputs, using the pipe and redirection as shown in
previous labs. Verify that this gives correct responses by redirecting the
output to a file, and using xxd on it.
Also try this on the file "all_values_0_to_255".
Questions
-
Use
xxd
on the file "all_values_0_to_255".
Is this file good for testing? Why or why not?
-
The file testfile does not have an extension.
Is it the same as a text file? Why or why not?
-
The file testfile.rtf is saved as a "Rich Text" file.
Is it the same as a text file? Why or why not?
-
The file testfile.doc is saved as a Microsoft Word™ format file.
Is it the same as a text file? Why or why not?
-
The file testfile.docx is saved as a Microsoft Word™ format file.
Is it the same as a text file? Why or why not?
-
The file testfile.pdf is saved as a portable document file.
Is it the same as a text file? Why or why not?
-
Of the different versions of the file, which ones were recognizable from
the output of your program?
-
Of the different versions of the file, how do they vary in size?
Notes:
-
Make one large program that does this.
If you want, use subroutines or macros to make this easier.
-
Your solution must compile with "nasm" on the SNOWBALL server.
-
The program should work for any input.
- You may be asked to meet with your TA to demonstrate your solution.
- Follow the instructions
for the labs and
Homework/Lab Pointers
for turning in your work.
-
Name your source file "hmwkY_XX.asm" and store it in your directory on
the class server (SNOWBALL). Replace "XX" with whatever
corresponds to your account, and
Y should be replaced with the appropriate number.
-
As you are aware certain types of assistance are inappropriate in
this class. Read the collaboration policy given to you at the beginning
of the semester, if you have any questions.