gcc - Programmatically cause Undefined Instruction exception -


i want cause arm cortex-m3 undefined instruction exception test of test fixture. iar compiler supports inline assembly this:

asm("udf.w #0");

unfortunately gnu cc inline assembler not know opcode nxp lpc177x8x. writes diagnostic:

ccw3kz46.s:404: error: bad instruction `udf.w #0' 

how can create function causes undefined instruction exception?

building on masta79's answer:

there "permanently undefined" encoding listed in armv7-m architecture reference manual - arm ddi 0403d (documentation placeholder, registration required). encoding 0xf7fxaxxx (where 'x' ignored). of course instruction fetches little-endian, (without testing):

asm volatile (".word 0xf7f0a000\n");

should yield guaranteed undefined instruction on armv7-m or later processor.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -