汇编代写-EE2220
时间:2021-11-18
EE2220 Computer Systems Fall 2021
Term Project: Half-Table Tennis
Submit online (Canvas) by 10:50 a.m. on 11/19, Friday
In this project, you are to write a HCS12 Assembly Language program which implements
a “half-table tennis game” with the IO LED and IT keyboard components. The IO LED
simulates an one-dimensional table, and the IT keyboard allows one to start, play and reset
the game using 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 LED’s (7, 6, 5, 4, 3, 2, 1, 0) 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 or only one LED must be lit red. The left-most LED (7)
represents a “wall” from which the ball automatically bounces, i.e., 6→ 7→ 6.
• The keys in the IT keyboard are used to play/control the game. The keys 1 through
4 are the play keys. The key 0 is the set key, the key A is the reset key, the key B is
the stop key, and key C is the resume key. How these keys are to be used is described
in Section 2.
2 Operation
• Initially (after execution of your program starts and before any key is pressed), all of
the 8 LED’s should be (stay) green.
• The initial location of ball, which is the right end (0) of the table, is set by pressing
the set key.
• With the ball at its initial location, you need to press one of the play keys to start to
move the ball to the left. Unless the stop or reset key is pressed, the ball continues
to move to the left, bounces back from the wall (7), and then starts to move to the
right. If the ball continues to move to the right, it eventually exits the table.
• While the ball moves to the right, you may press one of the play keys to bounce back
the ball to the left from the right end (0) of the table. In order to bounce back the
ball successfully, you must press a play key after the ball reaches the right end and
before it exits the table. Otherwise, the ball exits the table. When this happens, you
need to use the set key to bring the ball back on the table and then a play key to
start to move it.
• The speed at which the ball moves depends on the play key used for starting to move
or bouncing the ball. Let S1 be the speed for the key 1. Then, Sk = k · S1 where Sk
is the speed when the play key k is used.
• 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 is stopped. The stop key
is effective at any time only while the ball moves.
• Only following a stop, one may resume the game by pressing the resume key. When the
game is resumed, the ball speed must be the same as that before the pause (regardless
of the stopped position).
• The game may be reset by pressing the reset key at any time. Once the game is reset,
the program should go back to the initial state, i.e., all LED’s in green and the ball
is not set.
• Given a state, if a key is pressed which is not effective at that state, it should be
ignored.
• If any key other than the above-mentioned keys is pressed, it should be ignored.
• The speed control must be implemented using the timer (not by a software delay
routine).
3 Programming
Your program must be highly modularized such that all modules including the main module
are not too long, and well commented. In the beginning of each module, there should be a
description of what it does, and input and output parameters.
• 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.
• The interrupt service routine for the IT keyboard is provided in the Programming
folder (Canvas).
4 What to Submit
You need to submit a project report and a zip file of CodeWarrior Project.
Project report - a single PDF file including
• 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. Note that this is NOT a description of the
operation (which is given in this project description).
• A flowchart showing the structure of your program.
• The list file of your well-commented program.
Zip file
• Configure IO LED and IT Keyboard properly, and make sure that the contents of
memory variables are displayed in the memory window.
• Save the configuration.
• Zip the CodeWarrior Project folder of your term project. The zip file must include
all folders and files required for execution of your program.
5 Grading
• The project grade is distributed as follows: up to 10% for the description, up to
10% for the flowchart, up to 20% for the program structure (modularization, length,
comments, etc.), and the rest for the correctness and functionality.
• If any two programs are determined to be “the same” by the grader, both will re-
ceive no credit. For example, if one is copied from the other one through minor
modifications such as changing labels, adding few instructions (often unnecessary in-
structions), changing the order of instructions, etc., they will be considered to be the
same. Another example of copying is that two programs have the identical wrong or
poor implementation.


















































































学霸联盟


essay、essay代写