Content originally posted in LPCWare by IanB on Tue Mar 31 02:35:07 MST 2015
Found it! (Daft problem)
I forgot the .text directive after the code-protect-word section.
It seems a bit odd that everything else worked fine!
I like ADR - it's somehow "neater" than the "LDR =" solution which puts the data in the literal pool.
In the M3 it can set bit 0, but you have to write ADR R0,label+1
In the M0 it's rather a chocolate teapot of an instruction, as it can only generate even addresses, and it can't refer to labels in other sections (if the address it is trying to generate is in .rodata then it fails), so you can neither use it to refer to data tables, nor to jump tables.
I've also found out how what makes the editor colour the labels purple.
When setting up a new project.
If I start with the .c file that is automatically generated with the project, delete its contents and change its name to .s then all the text is black.
If I delete the .c file and then add another file File->new->other->general file, and call it .s then it colours the labels and assembler directives; but it makes no difference to how the assembler operates/