您的位置:首页 > 其它

.n suffix to branch instruction

2015-10-16 08:27 615 查看
004002a4:   b.n 0x4002f4 <write_four_registers_and_readback+172>
78               delay(10);


When Thumb-2 was introduced, ARM also introduced a new
Unified Assembler Language which allows writing code which can be assembled to either ARM or Thumb with (potentially) no modification. Most, if not all, recent toolchains default to UAL (although many still support the legacy syntaxes by some means).
In UAL, the
.n
and
.w
suffixes apply to mnemonics which have both a 16-bit Thumb ("narrow") and 32-bit Thumb-2 ("wide") encoding*. If unspecified, the assembler will automatically choose an appropriate encoding, but if
a particular encoding is desired (e.g. forcing a 32-bit encoding where the assembler would choose the 16-bit version in order to pad code for cache alignment), then the suffix can be specified.

Disassemblers will generally emit the suffixes to ensure that the output, if passed back through an assembler, will result in the exact same object code.

So, what you have there is a 16-bit Thumb branch instruction to address
0x4002f4
, which happens to be 172 bytes past the symbol
write_four_registers_and_readback
.

Technically, all ARM encodings are also "wide", and thus may take a
.w
suffix, but it's entirely redundant in that case.

http://stackoverflow.com/questions/27147043/n-suffix-to-branch-instruction
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: