Question: Please fix Assembly code (.asm) so that when the switches do not match the leds on the display border, decrement the score for the player.

Please fix Assembly code (.asm) so that when the switches do not match the leds on the display border, decrement the score for the player. Thank you! ; Implements properties of SCOMP to create a game to ; match switches on DE10-Lite to randomized LEDlights ; to score points ORG 0 LOADI 0 STORE Score STORE Counter CheckSwitchDown: IN Switches jzero Stepup Jump CheckSwitchDown Stepup: LOAD Counter ADDI 1 AND Mask STORE Counter OUT LEDs IN Switches jzero Stepup OUT Timer Match: IN Switches SUB Counter JZERO MatchScoreboard MatchScoreboard: IN Timer ADDI -1 XOR NegOne ADDI 1 ADD Score STORE Score OUT Hex0 LOAD Round ADDI 1 STORE Round Out Hex1 Jump CheckSwitchDown ; IO address Constants: Switches: EQU 000 LEDs: EQU 001 Timer: EQU 002 Hex0: EQU 004 Hex1: EQU 005 ; Variables Score: DW 0 Scoreboard: DW 0 Counter: DW 0 Mask: DW &B1111111111 NegOne: DW -1 Round: DW 1 ;NegOne: DW -1

Please fix Assembly code (.asm) so that when the switches do notmatch the leds on the display border, decrement the score for the

Make sure that the program works as required. In particular, - the score should start at 0, including when reset with KEY0, - the LED pattern should start over each round, - the score should increase and decrease as required, - the user should have to lower all switches between rounds, and - the round number should increase by 1 each round, win or lose. ; MatchGame.asm ; Implements properties of SCOMP to create a game to ; match switches on DE10-Lite to randomized LEDlights ; to score points ORG 0 LOADI 0 STORE Score STORE Counter CheckSwitchDown: IN Switches jzero Stepup Jump CheckSwitchDown Stepup: LOAD Counter ADDI 1 AND Mask STORE Counter OUT LEDS IN Switches jzero Stepup OUT Timer Match: IN Switches SUB Counter JZERO MatchScoreboard MatchScoreboard: IN Timer ADDI -1 XOR NegOne ADDI 1 ADD Score STORE Score OUT HexO LOAD Round ADDI 1 STORE Round Out Hex1 Jump CheckSwitchDown ; IO address Constants: Switches: EQU 000 LEDs: EQU 001 Timer: EQU 002 Hex0: EQU 004 Hex1: EQU 005 ; Variables Score: DW 0 Scoreboard: DW 0 Counter: DW 0 Mask: DW \&B1111111111 NegOne: DW -1 Round: DW 1 ; NegOne: DW -1

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 Databases Questions!