Question: Question # 1 In this question, you will write the keyboard and timer interrupt service routines to enable a simple game. The game uses a
Question # In this question, you will write the keyboard and timer interrupt service routines to enable a simple game. The game uses a D board with six slots on the screen. These slots are numbered and occupy the six leftmost cells of the top line of the screen. Therefore, slot is at xB: slot is at xB: slot is at xB: and so on The game is played between two players, represented by symbols X and Y who take alternate turns. Player always goes first. You may assume that, initially, the board contains empty spaces.The program at all times keeps track of a currentslotnumber between and to know which slot is currently selected.The keyboard ISR enables the following functionality: If the current player Player or Player presses the L key the currentslotnumber isdecremented by and if he presses the R key the currentslotnumber is incremented by However, the currentslotnumber is never allowed to go below or above If it is Player s turn and he presses enter, his symbol X is printed at the current slot stored in currentslotnumber on the screen, and the turn switches to Player If thecurrent slot already contains a symbol it is simply overwritten. If it is Player s turn and he presses enter, his symbol Y is printed at the current slotstored in currentslotnumber on the screen, and the turn switches to Player If thecurrent slot already contains a symbol it is simply overwritten. At the end of the ISR send EOI and IRET.Note: The Scan Codes of L and R keys are: x and x respectively. The scan code for enter is xCThe Timer ISR performs the following task: Check if any three consecutive slots on the board contain the same symbol ie either allthree are X or all three are Y If yes, print the winner and terminate the program. In this case, it should print either Player wins or Player wins. If no three consecutive slots on the board contain the same symbol, simply chain to the original timer ISR. Assume that the IP and CS of the original timer ISR are already stored at oldISR and oldISR in your program respectively. Write code in assembly language only Nasm AFD debugger
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
