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 # 1In this question, you will write the keyboard and timer interrupt service routines to enable a simple game. The game uses a 1D board with six slots on the screen. These slots are numbered 0,1,2,...5 and occupy the six left-most cells of the top line of the screen. Therefore, slot 0 is at 0xB800:0, slot 1 is at 0xB800:2, slot 2 is at 0xB800:4, and so on. The game is played between two players, represented by symbols X and Y, who take alternate turns. Player 1 always goes first. You may assume that, initially, the board contains empty spaces.The program at all times keeps track of a current_slot_number (between 0 and 5) to know which slot is currently selected.The keyboard ISR enables the following functionality: If the current player (Player 1 or Player 2) presses the L key the current_slot_number isdecremented by 1, and if he presses the R key the current_slot_number is incremented by1. However, the current_slot_number is never allowed to go below 0 or above 5. If it is Player 1s turn and he presses enter, his symbol X is printed at the current slot (stored in current_slot_number) on the screen, and the turn switches to Player 2. If thecurrent slot already contains a symbol it is simply overwritten. If it is Player 2s turn and he presses enter, his symbol Y is printed at the current slot(stored in current_slot_number) on the screen, and the turn switches to Player 1. 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: 0x46 and 0x33 respectively. The scan code for enter is 0x1C.The Timer ISR performs the following task: Check if any three consecutive slots on the board contain the same symbol (i.e. 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 1 wins or Player 2 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+2 in your program respectively. Write code in 8086 assembly language only (Nasm) AFD debugger

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!