I'm studying ARM Cortex-M3 with Thumb-2 instruction. I found some code that declares some data areas.
AREA RESET, DATA, READONLY
DULIEU DCB &0F,&0D,&7,&0A
The first code is for declaring hexa number: FD7A. What does the'&' mean before each byte?
AREA Data1, DATA, READONLY
xau DCB "Hello, World", CR
So how can the string "Hello, World" be stored in a byte? And what is CR?
The ARM assembler reference says that
&is used as a prefix for hexadecimal numbers, just like0x. So&0Fis equivalent to0x0F, the number fifteen.The DCB directive can be used to assemble multiple bytes, not just one. So
DCB "Hello, World"assembles the bytesH,e,l,l,o, etc, in sequence.I don't think
CRis defined by the assembler, but it is almost certainly a macro or equate for the number 10, the ASCII carriage return character, aka\r. You'll probably find it defined higher up in your program, or in some include file.