# CSCI 2400 - Computer Systems - Data Lab: Manipulating Bits ## Details This README provides more details about the assignment and details on how to develop, debug and grade your work. ## Developing & Debugging Your Puzzle Solutions There are five steps you need to go through. Each of those steps has a rule in the `Makefile` to lets you focus on that step: * Write valid puzzles (`make test-coding`) * Write correct puzzles (`make test-correctness`) * Only use allowed operations (`make test-ops`) * Figure out your score (`make test-score`) * Don't use too many operations (`make test-count`) You can run all of these steps using `make grade` but the step-by-step methods are useful to sort out *why* your solution is having problems. #### The `dlc` Compiler `dlc` is a modified version of an ANSI C89 compiler from that you can use to check for compliance with the coding rules for each puzzle. The `dlc` program only understands the C89 standard and thus enforces a stricter form of C declarations than is the case for C++ or that is enforced by `gcc`. Any declaration must appear in a block (what you enclose in curly braces) before any statement that is not a declaration. For example, it will complain about the following code: ``` int foo(int x) { int a = x; a *= 3; /* Statement that is not a declaration */ int b = a; /* ERROR: Declaration not allowed here */ b *= a; // ERROR -- this comment style causes error ``` The program runs silently unless it detects a problem, such as an illegal operator, too many operators, or forbidden code (`if`, `while`, *etc*) code in the integer puzzles. Don't include the `` header file in your `bits.c` file, as it confuses `dlc` and results in some non-intuitive error messages. You will still be able to use `printf` in your `bits.c` file for debugging without including the `` header, although `gcc` will print a warning that you can ignore. ## Grading The autograding script produces a report about 'points' -- this doesn't align with what we've described above (which is what holds). This happens in part because of the presence of the extra problems. #### `btest` This program checks the functional correctness of the functions in `bits.c`. To build and use it, type the following two commands: ``` unix> make unix> ./btest ``` Notice that you must rebuild `btest` each time you modify your `bits.c` file. You'll find it helpful to work through the functions one at a time, testing each one as you go. You can use the `-f` flag to instruct `btest` to test only a single function: ``` unix> ./btest -f bitOr ``` You can feed it specific function arguments using the option flags `-1`, `-2`, and `-3`. For example, the following specifies the first argument is `7` and the second is `0xf`. ``` unix> ./btest -f bitOr -1 7 -2 0xf ``` Here are the command line options for btest: ``` unix> ./btest -h Usage: ./btest [-hg] [-r ] [-f [-1|-2|-3 ]*] [-T