Hitting Bits with Assembly?
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
In Postlab 01 you implemented the game "Hit the Bit". Now let's do parts of it again, but this time in Assembly.
First, assume a4 holds the value of leds and the register a5 holds the new values of all switches. Enter a single line of assembly that will carry out "Task 3" from Postlab 1, specifically:
- For every LED that is on and the corresponding switch is on, turn the LED off
- For every LED that is on and the corresponding switch is off, keep the LED on
- For every LED that is off and the corresponding switch is on, turn the LED on
- For every LED that is off and the corresponding switch is off, keep the LED off
Make sure that after this line, a4 contains the updated LED state.
Write a line of code that carries out Task 3 from Postlab 1
Now assume a0 holds the memory address of the integer leds. Replicate the updateLeds function from Postlab 01 (you may find it helpful to reference your C implementation). Make sure at the by the end of your assembly, leds holds the updated value!
This problem has (and all RISCV coding questions have) a built-in debugger you're free to use. Details are here.