Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions