Reputation: 5367
Thumb mode instructions are 2 bytes and ARM mode instructions are 4 bytes. the screenshot is a disassembly of thumb mode instructions. why do I see 4 byte instructions mixed with 2byte instructions?? can someone explain this?
thank you in advance.
Upvotes: 9
Views: 2819
Reputation: 76
Cortex M micros can run only in Thumb-2 mode, which is something in between thumb and ARM modes. Thumbs-2 instruction set includes 16 and 32 bit instructions and processor don't need switch modes to execute both types of instructions.
Upvotes: 2
Reputation: 39
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471i/CHDFEDDB.html
or pdf
http://infocenter.arm.com/help/topic/com.arm.doc.dui0471i/DUI0471I_developing_for_arm_processors.pdf
Thumb-2 technology is available in the ARMv6T2 and later architectures. Thumb-2 technology is a major enhancement to the Thumb instruction set. It adds 32-bit instructions that can be freely intermixed with 16-bit instructions in a program. The additional 32-bit encoded Thumb instructions enable Thumb to cover most of the functionality of the ARM instruction set. The availability of 16-bit and 32-bit instructions enables Thumb-2 technology to combine the code density of earlier versions of Thumb with the performance of the ARM instruction set.
Upvotes: 2