Description
Purpose:
Points:
Become more familiar with data representation, program control instructions, procedure handling, stacks, and operating system interaction. 175
-
All source files must assemble and execute on Ubuntu with yasm.
-
Submit source files
-
Submit a copy of the program source file via the on-line submission.
-
Note, only the functions file (a10procs.asm) will be submitted.
-
-
Once you submit, the system will score the project and provide feedback.
-
If you do not get full score, you can (and should) correct and resubmit.
-
You can re-submit an unlimited number of times before the due date/time.
-
-
Late submissions will be accepted for a period of 24 hours after the due date/time for any given lab. Late submissions will be subject to a ~2% reduction in points per an hour late. If you submit 1 minute – 1 hour late -2%, 1-2 hours late -4%, … , 23-24 hours late -50%. This means after 24 hours late submissions will receive an automatic 0.
Program Header Block
All source files must include your name, section number, assignment, NSHE number, and program description. The required format is as follows:
-
Name: <your name>
-
NSHE ID: <your id>
-
Section: <section>
-
Assignment: <assignment number>
-
Description: <short description of program goes here>
Failure to include your name in this format will result in a loss of up to 10%.
Scoring Rubric
Scoring will include functionality, code quality, and documentation. Below is a summary of the scoring rubric for this assignment.
-
-
Criteria
Weight
Summary
Assemble
–
Failure to assemble will result in a score
of 0.
Program Header
3%
Must include header block in the
required format (see above).
General Comments
7%
Must include an appropriate level of
program documentation.
Program Functionality
90%
Program must meet the functional
(and on-time)
requirements as outlined in the
assignment. Must be submitted on time
for full score.
-
Debugging -> Command Line Arguments
When debugging a program that uses command line arguments, the command line arguments must be entered after the debugger has been started. The debugger is started normally (ddd <program>) and once the debugger comes up, the initial breakpoint can be set. Then, when you are ready to run the program, you must enter the command line arguments. This can be done either from the menu (Propgram -> Run which will display a window for the arguments) or in the GDB Console Window (at bottom) by typing run <commandLineArguments> at the (gdb) prompt.
Example Executions (with errors):
Below are some sample executions showing the error handling.
ed-vm% ./circles
Usage: circles -sp <triDecimalNum> -dc <triDecimalNum> -bk <triDecimalNum> ed-vm%
ed-vm%
ed-vm% ./circles -s 3 -dc 360178b -bk 0 Error, speed specifier incorrect. ed-vm%
ed-vm%
ed-vm% ./circles -sp 7 -dc 360178b -bk 0
Error, speed value must be between 1 and 4344(6).
ed-vm%
ed-vm%
ed-vm% ./circles -sp 5 dc 360178b -bk 0 Error, draw color specifier incorrect. ed-vm%
ed-vm%
ed-vm% ./circles -sp 15 -dc 360178b -bk 360178b Error, draw color and background color canbe the same. ed-vm%
ed-vm%
ed-vm% ./circles -sp 3 -dc 451354104520 -bk 0
Error, draw color value must be between 0 and 1355332143(6). ed-vm%
ed-vm%
ed-vm% ./circles -sp 3 -dc 360178b -bkk 0 Error, background color specifier incorrect. ed-vm%
ed-vm%
ed-vm% ./circles -sp 13 -dc 360178b -bk gray
Error, background color value must be between 0 and 1355332143(6). ed-vm%
In order to plot points with openGl, a series of calls is required. First, the draw color must be set, the point plot mode must be turned on. Then, the points can be plotted in a loop. Once all the points hve been plotted, the plot mode can be ended and the points dispalyed.
The following are the sequence of calls required:
glColor3ub(r,g,b) ;
glBegin(GL_POINTS);
-
plot calculations loop glVertex2d(x,y);
glEnd ();
glFlush ();
glutPostRedisplay();
The calls must be performed at assembly level with the appropriate argument transmission. For example, to set a draw color of red, glColor3ub (255, 0, 0), and set point plot mode, glBegin(GL_POINTS), the code would be as follows:
Below is a example execution showing the displayed output. The pattern will cycle and several static images of the cycling pattern are shown for reference.
ed-vm% ./circles -sp 1 -dc 360178b -bk 0