C8 Computer organization · Practice
Assembly lab
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Check
Leave the largest of the five signed words in vals in a0.
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
Copy the three words at src to dst (src is at 0x1000, dst at 0x100C).
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
Count the 1 bits in a0 (an 8-bit value) and leave the count in a1.
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
a0 and a1 hold two positive numbers. Leave their greatest common divisor in a0.
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
What does andi t0, a0, 1 leave in t0 when a0 = 92?
Check
A .data section starts at 0x1000 with a list of words. Where is word 4 (counting from 0)?
Check
For two positive numbers 30 and 18, what is the most subtraction steps Euclid's algorithm by subtraction could possibly need (a loose bound: a + b − 1)?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C8