C12 Embedded systems in MicroPython and C · Practice
Debugging: breakpoints, stepping and watching memory
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
An array of 2-byte elements starts at 1040. What address does element 10 read, in hex?
Check
A breakpoint sits inside a loop of 8 passes, nested in a loop of 4 passes. How many times does it stop the program?
Check
A program prints 20 characters over a UART at 9600 baud, waiting for each. How long does it take?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
A loop meant to average 8 samples, each 512, runs one pass too many and adds the next value in memory, 60000, before dividing by 8. What does it compute?
Check
An array of 8-byte elements starts at 4096.
(a)
What address does element 3 occupy?
(b)
How many bytes does the debugger's memory view show for one element?
Check
A program prints a 40-character line over a 9600-baud UART and waits for each character.
(a)
How long does it spend printing?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
(b)
How many 10 MHz cycles is that?
Check
Address of element 12 of 2-byte elements at 1000?
Check
Stops for a breakpoint in a 12-pass loop inside a 5-pass loop?
Check
Time to print 32 characters at 9600 baud?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
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 C12