Table of Contents

Corning Community College

CSCS2650 Computer Organization

PROJECT: Move The Block (MTB3)

OBJECTIVE

The moment is finally here: with your implemented debugging subroutines at hand, adapt your hand-written assembly pong into a playable breakout game, with brick field.

EDIT

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

Breakout

brick field

manifestation in memory

When looking at the bricks in breakout, it makes sense to see them as an array, which are a very simple concept in assembly, as it is just a contiguous chunk in memory. That said, when initializing our block field, we are just initializing an area in memory with specific values to access later on.
When looking to initialize our memory, we have to consider everything we may use for our blocks, which may be just an xpos, ypos, and active flag, and give enough space to hold everything. There are multiple ways of going about this depending to the constraints you have; if you are looking for space efficiency, you may want to pack your data into one word each, then decoding later when we need to use it; if you are looking for ease of use, you may just want to give each attribute its own word in memory. To take the latter approach, you will want to initialize each attribute based on a starting position, then move that starting position along to affect each block. This may look like:

_init:
mov R0, 0x00000000 ; memaddr
mov R1, 1          ; activeflag
mov R2, 0          ; xpos
mov R3, 0          ; ypos
_brickinitloop
mov  [R0],   R1
mov  [R0+1], R2 
mov  [R0+2], R3
iadd R0,     3
iadd R2,     BlockWidth
; add some sort of break condition
jmp  _brickinitloop

logic for accessing

If you gave each attribute of the brick its own memory address (for example active flag, xpos, ypos) we can access them by going back to that address. If you used 0x00000000 as your starting address for defining the brick field for example, you would set a register to that memory address and then read from it and its following addresses as such:

     mov  R0,        0x00000000  ; move starting address into R0

_brick_activeflag:
     mov  R1,        [R0]        ; load the value in the active flag memory address for the chosen brick
     ieq  R1,        1           ; display the brick if the flag is active
     jt   R1,        _display_brick
     ; repeat loop if not active

Similarly when displaying the bricks we can use [R0+1] and [R0+2]. Since R0 is the memory address of our brick and each brick has three addresses (active flag, xpos, ypos), [R0] is the active flag [R0+1] is the xpos and [R0+2] is the ypos.

 

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:

234:mtb3:final tally of results (234/234)
*:mtb3:submitted handwritten assembly [26/26]
*:mtb3:submitted Vircon32 cartridge [26/26]
*:mtb3:submitted XML and build script [26/26]
*:mtb3:brickfield displayed and collisions work [26/26]
*:mtb3:day 1 snapshot of progress to class discord [26/26]
*:mtb3:day 2 snapshot of progress to class discord [26/26]
*:mtb3:day 3 final effort demoed to class discord [26/26]
*:mtb3:cartridge is NOT added to repository [26/26]
*:mtb3:committed project related changes to semester repo [26/26]

Pertaining to the collaborative authoring of project documentation

Additionally