Master the fundamental concepts of instruction set architecture through this focused micro-challenge.
Thumb-2 is ARM's 16/32-bit mixed ISA used on Cortex-M microcontrollers. Most instructions compress to 16 bits for flash savings; hot paths use 32-bit encodings for full ARM32 expressiveness without switching CPU mode.
cLoading…
Embedded devices care about code size in on-chip flash:
For example, an infinite blink loop on STM32 is almost entirely Thumb-16 B.N and STR instructions packed sequentially.
For this exercise, you will decode sample Thumb-2 halfwords and identify 16 vs 32-bit instruction boundaries. This task asks you to read the ISA map in the ARMv7-M manual the way firmware engineers do when patching a bootloader.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Explore Thumb-2 instruction set and compare to ARM32.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github