Nasm Assembly Programming Assignment 6
Goal: File properties program
Step 1. Creating the assembly language file
Everything should be done the same way as the previous assignment.
Step 2. The application area
This assignment will give practice at using a struct and working with C library
The goal is very simple. Your program should take a file name and print the time
since the file was last modified.
We have already discussed in class how to find out the current time.
The tool you need to determine when a file was last modified is stat() or fstat().
These will return a lot of information about a file. You can ignore almost all of this
information except for the time modified.
Additional discussion: https://stackoverflow.com/questions/11765683/how-toread-
Note that stat can be used from the command line as well (see
http://labtestproject.com/linuxcmd/stat.html) but we want to call it as a function.
Discussion of the difference between timeval and timespec:
Aside: ISO 8601 date format: https://askubuntu.com/questions/355188/dateformat-
Step 3. What your code should do
1. Your code should use STDIN and STDOUT for input and output. (This is the
default.) Use redirection on the command line to read from a file and write to a
file. Or you can take the file name from the command line as I did with the
Cryptoquip helper example I went over in class.
2. Your code should take a file name as input.
3. The code should output the length of time since the file was last modified. The
format is days, hours, minutes and seconds.
4. The program should call stat() or similar function to get the modification
time of the file in question.
5. This program should use glibc functions for input and output..
Step 4. Turning in the assignment
Turn in the following:
1. Commented listing file.
2. Demonstration of functioning for several different files that were modified
several days previously.
3. Include command line output of ls -l for the files so we can verify the
Recently Asked Questions
- would you be able to help me with this question? I have uploaded my problemset. please show me the step by step guide
- Suppose labour and capital are perfect complements. In particular, the producer needs to use 2 units of labour for each unit of capital. Suppose the
- Find the center of x 2 + y 2 - 10x - 8y + 1 = 0. (-5, -4) (5, 4) (-10, -8)