Here's Lab 5c. Lab 5b isn't due yet, but 5c is being posted early for those of you who get finished early.
Here is some sample Lab 5b interaction so that you know what kind of output to expect.
I have attached the expected 32-bit solution as well as the 64-bit on 32-bit machine solution. Note that in the 64-bit solution, we have a slightly simplified case of 64-bit division, since we can assume that the denominator, n+1, is 32 bits, and thus we can assume that the remainder is 32 bits as well.
Here is some sample Lab 5a interaction. Note that your error messages can be different, but, when there is an error, you should have some sort of error message outputted to stderr and have your program exit with a nonzero exit code.
The POSIX standard for handling command line options is here: Utility Syntax Guidelines. Note that the getopt() function already does most of what you need to do, but your code will have to handle repeated options correctly. Also, you will need a small bit of code to check that you get all required options and that you have the correct number of operands (one, the trace file).
Here is an example trace, the one that I used above:
0x7ff85467 0x08048924 0x4f356728 0x7d2e426b 0x704f5437 0x2a6f3652 0xa3683a5e 0x3b323078 0x6a73527e
This is part one of a three week lab on writing a cache simulator in C.
Note that the example turn in file name in the writeup has a *.S extension, but, for this one, you should naturally use *.c.