|
| 1 | +--- |
| 2 | +title: "ARM Assembler Diagnostic Messages | Microsoft Docs" |
| 3 | +ms.custom: "" |
| 4 | +ms.date: "2018-06-30" |
| 5 | +ms.prod: "visual-studio-dev14" |
| 6 | +ms.reviewer: "" |
| 7 | +ms.suite: "" |
| 8 | +ms.technology: |
| 9 | + - "devlang-cpp" |
| 10 | +ms.tgt_pltfrm: "" |
| 11 | +ms.topic: "article" |
| 12 | +dev_langs: |
| 13 | + - "C++" |
| 14 | +ms.assetid: 52b38267-6023-4bdc-a0ef-863362f48eec |
| 15 | +caps.latest.revision: 8 |
| 16 | +author: "corob-msft" |
| 17 | +ms.author: "corob" |
| 18 | +manager: "ghogen" |
| 19 | +--- |
| 20 | +# ARM Assembler Diagnostic Messages |
| 21 | +[!INCLUDE[blank_token](../../includes/blank-token.md)] |
| 22 | + |
| 23 | +The latest version of this topic can be found at [ARM Assembler Diagnostic Messages](https://docs.microsoft.com/cpp/assembler/arm/arm-assembler-diagnostic-messages). |
| 24 | + |
| 25 | + |
| 26 | +The Microsoft ARM assembler (*armasm*) emits diagnostic warnings and errors when it encounters them. This article describes the most commonly-encountered messages. |
| 27 | + |
| 28 | +## Syntax |
| 29 | + |
| 30 | +``` |
| 31 | + |
| 32 | +filename(lineno) : [error|warning] Anum: message |
| 33 | +``` |
| 34 | + |
| 35 | +## Diagnostic Messages |
| 36 | + |
| 37 | +### Errors |
| 38 | + A2193: this instruction generates unpredictable behavior |
| 39 | + The ARM architecture cannot guarantee what happens when this instruction is executed. For details about the well-defined forms of this instruction, consult the [ARM Architecture Reference Manual](http://go.microsoft.com/fwlink/?LinkId=246464). |
| 40 | + |
| 41 | +``` |
| 42 | + |
| 43 | +ADD r0, r8, pc ; A2193: this instruction generates unpredictable behavior |
| 44 | + |
| 45 | +``` |
| 46 | + |
| 47 | + A2196: instruction cannot be encoded in 16 bits |
| 48 | + The specified instruction cannot be encoded as a 16-bit Thumb instruction. Specify a 32-bit instruction, or rearrange code to bring the target label into the range of a 16-bit instruction. |
| 49 | + |
| 50 | + The assembler may attempt to encode a branch in 16 bits and fail with this error, even though a 32-bit branch is encodable. You can solve this problem by using the `.W` specifier to explicitly mark the branch as 32-bit. |
| 51 | + |
| 52 | +``` |
| 53 | + |
| 54 | + ADD.N r0, r1, r2 ; A2196: instruction cannot be encoded in 16 bits |
| 55 | + |
| 56 | + B.W label ; OK |
| 57 | + B.N label ; A2196: instruction cannot be encoded in 16 bits |
| 58 | + SPACE 10000 |
| 59 | +label |
| 60 | + |
| 61 | +``` |
| 62 | + |
| 63 | + A2202: Pre-UAL instruction syntax not allowed in THUMB region |
| 64 | + Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax is no longer accepted |
| 65 | + |
| 66 | +``` |
| 67 | + |
| 68 | +ADDEQS r0, r1 ; A2202: Pre-UAL instruction syntax not allowed in THUMB region |
| 69 | +ADDSEQ r0, r1 ; OK |
| 70 | + |
| 71 | +``` |
| 72 | + |
| 73 | + A2513: Rotation must be even |
| 74 | + In ARM mode, there is an alternate syntax for specifying constants. Instead of writing `#<const>`, you can write `#<byte>,#<rot>`, which represents the constant value that is obtained by rotating the value `<byte>` right by `<rot>`. When you use this syntax, you must make the value of `<rot>` even. |
| 75 | + |
| 76 | +``` |
| 77 | + |
| 78 | +MOV r0, #4, #2 ; OK |
| 79 | +MOV r0, #4, #1 ; A2513: Rotation must be even |
| 80 | + |
| 81 | +``` |
| 82 | + |
| 83 | + A2557: Incorrect number of bytes to write back |
| 84 | + On the NEON structure load and store instructions (`VLDn`, `VSTn`), there is an alternate syntax for specifying writeback to the base register. Instead of putting an exclamation point (!) after the address, you can specify an immediate value that indicates the offset to be added to the base register. If you use this syntax, you must specify the exact number of bytes that were loaded or stored by the instruction. |
| 85 | + |
| 86 | +``` |
| 87 | + |
| 88 | +VLD1.8 {d0-d3}, [r0]! ; OK |
| 89 | +VLD1.8 {d0-d3}, [r0], #32 ; OK |
| 90 | +VLD1.8 {d0-d3}, [r0], #100 ; A2557: Incorrect number of bytes to write back |
| 91 | + |
| 92 | +``` |
| 93 | + |
| 94 | +### Warnings |
| 95 | + A4228: Alignment value exceeds AREA alignment; alignment not guaranteed |
| 96 | + The alignment that is specified in an `ALIGN` directive is greater than the alignment of the enclosing `AREA`. As a result, the assembler cannot guarantee that the `ALIGN` directive will be honored. |
| 97 | + |
| 98 | + To fix this, you can specify on the `AREA` directive an `ALIGN` attribute that is equal to or greater than the desired alignment. |
| 99 | + |
| 100 | +``` |
| 101 | + |
| 102 | +AREA |.myarea1| |
| 103 | +ALIGN 8 ; A4228: Alignment value exceeds AREA alignment; alignment not guaranteed |
| 104 | + |
| 105 | +AREA |.myarea2|,ALIGN=3 |
| 106 | +ALIGN 8 ; OK |
| 107 | + |
| 108 | +``` |
| 109 | + |
| 110 | + A4508: Use of this rotated constant is deprecated |
| 111 | + In ARM mode, there is an alternate syntax for specifying constants. Instead of writing `#<const>`, you can write `#<byte>,#<rot>`, which represents the constant value that is obtained by rotating the value `<byte>` right by `<rot>`. In some contexts, ARM has deprecated the use of these rotated constants. In these cases, use the basic `#<const>` syntax instead. |
| 112 | + |
| 113 | +``` |
| 114 | + |
| 115 | +ANDS r0, r0, #1 ; OK |
| 116 | +ANDS r0, r0, #4, #2 ; A4508: Use of this rotated constant is deprecated |
| 117 | + |
| 118 | +``` |
| 119 | + |
| 120 | + A4509: This form of conditional instruction is deprecated |
| 121 | + This form of conditional instruction has been deprecated by ARM in the ARMv8 architecture. We recommend that you change the code to use conditional branches. To see which conditional instructions are still supported, consult the [ARM Architecture Reference Manual](http://go.microsoft.com/fwlink/?LinkId=246464). |
| 122 | + |
| 123 | + This warning is not emitted when the `-oldit` command-line switch is used. |
| 124 | + |
| 125 | +``` |
| 126 | + |
| 127 | +ADDEQ r0, r1, r8 ; A4509: This form of conditional instruction is deprecated |
| 128 | + |
| 129 | +``` |
| 130 | + |
| 131 | +## See Also |
| 132 | + [ARM Assembler Command-Line Reference](../../assembler/arm/arm-assembler-command-line-reference.md) |
| 133 | + [ARM Assembler Directives](../../assembler/arm/arm-assembler-directives.md) |
| 134 | + |
0 commit comments