Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ELEC 2220 Computer Systems Fall 2012 Term Project: Pingpong Game due on 11/30/12, Friday, in class In this project, you are to write a HCS12

ELEC 2220 Computer Systems Fall 2012 Term Project: Pingpong Game due on 11/30/12, Friday, in class In this project, you are to write a HCS12 Assembly Language program which implements a simple pingpong game with the IO LED and IT keyboard components. The IO LED simulates an one-dimensional pingpong table and the IT keyboard allows one to start, play and reset the game through the interrupt mechanism. An interrupt (IRQ) is generated when a key on the IT keyboard is pressed with a proper set-up. 1 Components The IO LED component has eight LEDs each of which is a possible ball location. When the ball is at a certain location, the corresponding LED is lit red. At any time, no more than one LED must be lit red. The keys in the IT keyboard are used to play/control the game. Keys 0 through 9 are referred to as play keys. The pingpong game is to begin when any of the play keys 0 through 9 is pressed (refer to Section 2). The key A is the stop key and the key B is the reset key. 2 Operation Initially (after your program starts and before any key is pressed), all of the 8 LEDs should be (stay) green. Once the game starts (only upon pressing any play key), the ball (a LED in red), starting at the left-most position, is continuously shifted to the right at the speed of (PK + 1) base speed where PK is the value of a play key (0 through 9), until a new key is pressed. The base speed is the slowest speed corresponding to key 0. This speed control must be done using the timer (but not necessarily the calculation). The objective of the game is to bounce back the ball from both ends (i.e., the left- most and right-most LEDs) of the pingpong table by pressing any of the play keys. The moment at which a play key is pressed to be able to bounce back the ball from either end has to be between the two time instances corresponding to the two end positions. The ball starts to shift in the other direction once successfully bounced back (otherwise, it is wrapped around to the other end). One may try the play keys in any order. Upon the successful bouncing-back, the speed at which the ball moves (shifts) is changed depending on the play key pressed, i.e., (P K + 1) base speed. The game may be stopped (paused) by pressing the stop key. Once the game is stopped, the ball should stay at the same position where it was stopped. Following a stop, one may only resume the game by pressing any play key. When the play is resumed, the ball speed must be the same as that before the pause. The game may only be reset by pressing the reset key following a stop. Once the game is reset, all the components should go back to the initial state. Then, one may start to play another game by pressing any play key. 3 Programming Your program must be highly modularized and well commented. In the beginning of each module, there should be a description of what it does and, input and output parameters. 4 The interrupt vector number for the IT keyboard is 6, and the address of the corre- sponding interrupt service routine must be stored at $FFF2. Use the same port assignments as Homework #9. What to Submit You need to submit a report consisting of: A description of your implementation (coding), i.e. how your program is modularized, how each module including the main program is implemented, what parameters are passed and how they are used, etc. This is NOT a description of the operation which is given in this project assignment (Suggested length: 1-2 pages). A flowchart (similar to those drawn in class) showing the structure of your program. You should include flowcharts for all subroutines and interrupt service routines. The list file of your well-commented program. You should also include in the comments which ports are connected to each component. Email the GTA (rzg0022@auburn.edu) a copy of your source code (.asm). Follow the format outlined on the class website. For the subject, use ELEC2220 Project and for the assembly file name use PLastName. You must email your source code before 11:00 AM on Friday 11-30-12. Failure to submit a copy of your code by the deadline will result in a 0 for your program. Code received after 11:00 AM on Friday 11-30-12 will be considered late and will receive a 0. 5 Grading You will need to submit your project in class on Friday 11-30-12. The project grade is distributed as follows: 10% for the description, 10% for the flowchart, 10% for the presentation, 20% for the program structure (modularization, length, comments, etc.) and 50% for correctness and functionality. If any two programs are determined to be the same, both will receive no credit. For example, if one is copied from another through minor modifications such as changing labels, adding a few instructions (often unnecessary instructions), changing the order of non-critical instructions, etc., they will be considered to be the same. In addition, two programs that have an identical wrong implementation will be considered the same as well. You will receive a 0 for the entire project for copying. You will receive a 0 for any item that is submitted late.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions