Hi,
Where can I find opcode list of MSP430 family? What is the behavior of this family if I try executing an illegal opcode? Can I catch this condition?
Thank you,
BP.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
Where can I find opcode list of MSP430 family? What is the behavior of this family if I try executing an illegal opcode? Can I catch this condition?
Thank you,
BP.
There are only very few opcodes that do not have a meaning. On the old 1x series, there have been almost all opcodes below 0x2000 no meaning, except for the 0x1000-0x133f range.
On newer MSPs, there are only a few holes in the 0x1000-0x13ff range.
Since input and output operand and addressing mdoe are part of the opcodes, there are few commands covering almost all ofo the 64k of possible opcodes.
There is no way to catch an illegal opcode condition and I don't know what the CPU will do if you try. It might cause a RESET, bu tthen I didn't see any flag for it in the reset interrupt vector table and I didn't see anything about it mentioned anywhere.
The question is: why do you think that it might be necessary to catch an invalid opcode? Unless you load data from an unsafe source and try to execute it, there should never be an invalid opcode anywhere. This is a microcontroller and not a general-purpose CPU like an Intel/AMD x86. :)
If it ever should happen that an invalid opcode is executed on a finished device, you should buy a new device (or hire a better programmer).
Even if you update your code online, it should be secured by CRCs and other ways that only 100% checked and valid code is written to it.
So the question is not 'how to detect an invalid opcode' but 'how to prevent an invalid opcode 100% for sure'
Hello,
I was looking for some similar info.
Here is an external link that is helpful: http://mspgcc.sourceforge.net/assemble.html
Disclaimer: Use at your own risk!
Regards,
PT
An example of illegal op-code:
- Alignment error,
- An erroneous execution of code from the data area
- etc
(during debugging programs on XXXX-RTOS)
**Attention** This is a public forum