In this assignment you will:
- Continue writing and calling functions in x86 assembly.
- Use bit operations to compactly represent set membership.
- Use bit operations to efficiently extract meaning from data.
In completing this assignment you MAY use/access the following resources:
You may NOT use/access:
- Resources not expressly listed above, including, but not limited to,
the following ...
- Source code not provided as part of this assignment. (Obviously, this
includes, but is not limited to, source code written by other students
whether current or in the past).
- Code-generating tools (of which ChatGPT is one of many examples).
- Any web sites not directly linked to from the homework assignment.
Failure to abide by these guidelines will result in a zero for the assignment
and the incident will be reported to the university provost as a violation of
the university academic integrity policy. A second incident of academic
dishonesty (whether from this course or another computer science course) will
result in an F in the course.
IMPORTANT: To get the latest version of the nerds.txt data file mentioned
below be sure to pull from origin before you start the assignment.
This assignment provides an opportunity to practice efficient data
representation of a set using a bit string. In particular, we will explore the
wonderful world of the virtual nerd card in which up to 64 nerd achievements are
given ids numbered from 0 to 63. The achievements of an individual can thus be
represented using a single 64-bit register where a 1 in bit position 0 means
they have credit for achievement 0. A 0 in that bit position means they do not
have credit for achievement 0.
The latest version of the homework repository has the following files in the
hw11 directory:
- codes.txt
- is a data file containing definitions of nerd
achievements with one achievement per line. Each line has an id number,
a number of points, and a description. The description will be no more
than 256 characters and the achievments are given in order of id number
(starting at 0). This data file was generated from the actual nerd
card app at https://csci.hsutx.edu/nerdcard. If you want to see how
you rank feel free to register and then mark your achievements!
- nerds.txt
- is a data file containing a list of nerds and their nerd
achievements. The data included is partial data from the actual app.
If your name does not appear it is because I didn't see it or recognize
it when pulling data. The format of this file is: the nerd screen name
is on a line by itself, followed by a line of nerd achievement id numbers
(separated by spaces).
- readcodes.c
- provides a C language function that can be used to
read the codes.txt data file and store it in an array of pointers
to records.
- nerdcard.asm
- provides some starter code for this assignment
including a call to readCode and an assembly function that
display's the codes that were read.
Modify nerdcard.asm as follows:
- comment out the call to the displayCodes function as that
will not be part of the final program.
- write a function called readNerds that will process nerds.txt
and will build a bit-string representing each nerd's achievements. The
nerd's name and achievement bit string should be stored in an array and
the number of entries read should be returned.
- write a function called displayNerds that displays the list of
nerds along with their integer code.
- write a function called doneByAll that lists achievements
that that been accomplished by all nerds in the list. This function
should make efficient use of bit operations to produce a single
64-bit code that identifies which achievements are universal.
- write a function called doneByNone that lists achievements
that that been accomplished by none of the nerds in the list using
a similar technique as before.
The output of your program should include a list of nerds and the 64-bit
code (it is fine to just display the code as an int using the I/O macros
even though it will only show the lower-order 32 bits). It should also
produce a list of achievements that everyone has attained and a list of
achievements that no one has attained.
The (partial) output of my program is as follows:
0 washby 1931468414
1 sergeant 1526944368
...
10 rohtherizzler -750615950
11 Phoenix -1073570216
12 dsouth 939759220
13 Saku77 -2147318920
------------------------------------------
Achievements Everyone Has ...
------------------------------------------
6 NANO/VI | Use NANO or VI as your primary way to edit files.
...
------------------------------------------
Achievements Nobody Has ...
------------------------------------------
0 Starting Counting at Zero | Start every list with zero ... especially in assembly language programming assignments.
...
Do your work in the hw11 directory of your homework repository. Push
your committed changes to BitBucket before the due date.
Your program will be graded according to the following criteria:
| Correctness/Completeness |
20 |
pts |
| Documentation |
2 |
pts |
| x86 Conventions |
2 |
pts |
| Total |
24 |
pts |
See Homework #6 for instructions on proper documentation and on x86 assembly language conventions.