Difference between revisions of "CSC231 Homework 6 2017"

From dftwiki3
Jump to: navigation, search
Line 10: Line 10:
 
==Problem Statement==
 
==Problem Statement==
 
<br />
 
<br />
Write an assembly language program called '''hw6.asm''' similar to the one with work out in class, but with a few important differences, listed below.  You can find the program we wrote in class [[CSC231_Developing_the_Game_of_Life_in_Assembly | here]].
+
Write an assembly language program called '''hw6.asm''' that implements a 1-dimensional ''game of life'', similar to the one with work out in class, but with a few important differences, listed below.  You can find the program we wrote in class [[CSC231_Developing_the_Game_of_Life_in_Assembly | here]].
 
<br />
 
<br />
:# Your program will use an ''include'' file to get the array dish, which contains the initial 1-line generation of cells.   
+
:# Your program will use an ''include'' file to get the array '''dish''', which contains the initial generation of cells.   
 
:# Your program will not use a single '''loop''' instruction, and will implement all the loops using '''cmp''' and '''jump''' instructions (conditionals and unconditional jumps will be used).
 
:# Your program will not use a single '''loop''' instruction, and will implement all the loops using '''cmp''' and '''jump''' instructions (conditionals and unconditional jumps will be used).
:# Your program will not necessarily set the first and last cells of newGen to 0, as the program we wrote in class did.  The first and last cells of dish are different from the others in that they only have 1 neighbor. The first cell, at Index 0, has a neighbor in the cell at Index 1.  The last cell, at Index N-1, has one neighbor, at Index N-2.  While our program automatically decided that the first and last cells would die in the next generation, your program won't.  Instead it will see if these boundary cells have 1 live neighbor or not, and if they do have a live neighbor in dish, will make them live in newGen.
+
:# Your program will not necessarily set the first and last cells of newGen to 0, as the program we wrote in class did.  The first and last cells of dish are different from the others in that they only have 1 neighbor.   While our program automatically decided that the first and last cells would die in the next generation, your program won't.  Instead it will see if these boundary cells have 1 live neighbor or not, and if they do, will make them live in newGen.
 
<br />
 
<br />
 
==Using an Include File==
 
==Using an Include File==
 
<br />
 
<br />
The concept is simple: you put part of the code into a separate file, and you use an "''%include''"  statement inside the main program to tell nasm that it should read the contents of the include file as part of this program.
+
The concept of an include file is simple: you put part of the code into a separate file, and you use an "''%include''"  statement inside the main program to tell nasm that it should read the contents of the include file as part of this program.
 
<br />
 
<br />
 
The code below illustrates how this is done.  We have two files:
 
The code below illustrates how this is done.  We have two files:
Line 163: Line 163:
 
This is what the evaluateHw6.sh program does: it makes a copy of your hw6.asm program in a new directory, puts there a different, unknown (to you) dishArray.inc file, assembles and links the two, and run the resulting executable, comparing its output to the output of the solution program.
 
This is what the evaluateHw6.sh program does: it makes a copy of your hw6.asm program in a new directory, puts there a different, unknown (to you) dishArray.inc file, assembles and links the two, and run the resulting executable, comparing its output to the output of the solution program.
 
<br />
 
<br />
 +
==Submission==
 +
<br />
 +
* Submit your program on Moodle, in the Homework 6 section.
 
</onlydft>
 
</onlydft>
 
<br />
 
<br />

Revision as of 20:36, 1 April 2017

--D. Thiebaut (talk) 18:56, 1 April 2017 (EDT)


Game Of Life Without Loop Instructions


For this assignment, you need to write a game of life program in assembly, and the challenge is to implement it without using the loop instruction, using only the cmp instruction and conditional jumps.



...