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
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 -1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started