Table of Contents

Corning Community College

CSCS2650 Computer Organization

PROJECT: Breakout In Assembly (BIA0)

OBJECTIVE

This week the effort will be towards implementing an assembly breakout game.

EDIT

You will want to go here to edit and fill in the various sections of the document:

BIA0

Arrays of Structs in Assembly

In Breakout coded in C, we used an array of brick structs to keep track of all the bricks on the field. When porting over to assembly, the approach needs to be changed due to a multitude of factors.

Arrays don't formally exist in assembly. Since in array is simply an unchanging space of sequential memory, the stack must include the data for all the bricks in order. For breakout, each brick has five properties:

  1. X-axis Position
  2. Y-axis Position
  3. Color
  4. Health
  5. Visibility Toggle

Accessing an individual array element uses an ID value to get that position's specific data. In Assembly, we use a register to hold the memory address of a given element's first property. Here's an example in practice:

The first Brick's X Position is in BP-24(The 24th element in the Stack). We copy this memory address and store it within a general register (preferably a later one so its not likely to get overwritten):

mov  R0,  BP
isub R0,  24
mov  R10, R0

Within our for-loop we use to access all the bricks sequentially, we reference individual elements through R10. (i.e. [R10-3] is the current Brick's color value.)

When moving from one brick to the next, we directly adjust the memory address stored in R10. It's simple in practice:

isub R10, 5

This reference point moves from the current Brick's X Position, to the next Brick's X Position. This way, our relative point R10 doesn't change when inside any brick. This allows for loops to work with arrays.

 

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

Submit Tool Usage

Let's say you have completed work on the project, and are ready to submit, you would do the following:

lab46:~/src/SEMESTER/DESIG/PROJECT$ submit DESIG PROJECT file1 file2 file3 ... fileN

You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.

RUBRIC

I'll be evaluating the project based on the following criteria:

52:bia0:final tally of results (52/52)
*:bia0:start of effort toward assembly implementation [52/52]

Pertaining to the collaborative authoring of project documentation

Additionally