C8 Computer organization · Practice
Linking, loading and startup code
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.
0 solved
0 in a row
0 of 9 kinds solid
Check
A firmware image has 30 kB of .text, 1 kB of .rodata, 2 kB of .data and 10 kB of .bss, and reserves 1 kB of stack.
(a)
How much flash does it need?
(b)
How much RAM does it need?
Check
What does auipc t0, 1 at address 1000 put in t0?
Check
la a0, buf sits at 0040, and buf is at 1800.
(a)
What immediate does the auipc hold?
(b)
What immediate does the addi hold?
Check
Startup code copies 2048 bytes of .data a word at a time, taking 5 cycles per word on a 48 MHz clock. How long does the copy take?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
Check
Startup copies 400 bytes of .data (5 instructions a word) and zeroes 2000 bytes of .bss (3 a word) at 48 MHz.
(a)
How many instructions does that take?
(b)
How long, at one instruction a cycle?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
Check
A map file lists .text 9000, .rodata 800, .data 900 and .bss 6000 bytes, with a 1024-byte stack.
(a)
How much flash does it use?
(b)
And how much RAM?
Check
8 kB of code, 1 kB of constants and 4 kB of initialized data: how much flash?
Check
1 kB of .data, 4 kB of .bss and 4 kB of stack: how much RAM?
Check
What does auipc t1, 2 at 0200 produce?
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