Skip to content

Commit 8bc0a0e

Browse files
committed
Migration: migration from Caps to OP
1 parent 5fe40b1 commit 8bc0a0e

File tree

18,312 files changed

+1619820
-10984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

18,312 files changed

+1619820
-10984
lines changed

docs/TOC.md

+41-10,984
Large diffs are not rendered by default.

docs/assembler/arm/TOC.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# [ARM Assembler Reference](arm-assembler-reference.md)
2+
# [ARM Assembler Command-Line Reference](arm-assembler-command-line-reference.md)
3+
# [ARM Assembler Directives](arm-assembler-directives.md)
4+
# [ARM Assembler Diagnostic Messages](arm-assembler-diagnostic-messages.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: "ARM Assembler Command-Line Reference"
3+
ms.custom: ""
4+
ms.date: "10/28/2016"
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: f7b89478-1ab5-4995-8cde-a805f0462c45
15+
caps.latest.revision: 12
16+
author: "corob-msft"
17+
ms.author: "corob"
18+
manager: "ghogen"
19+
translation.priority.ht:
20+
- "cs-cz"
21+
- "de-de"
22+
- "es-es"
23+
- "fr-fr"
24+
- "it-it"
25+
- "ja-jp"
26+
- "ko-kr"
27+
- "pl-pl"
28+
- "pt-br"
29+
- "ru-ru"
30+
- "tr-tr"
31+
- "zh-cn"
32+
- "zh-tw"
33+
---
34+
# ARM Assembler Command-Line Reference
35+
This article provides command-line information about the Microsoft ARM assembler, *armasm*, which compiles ARMv7 Thumb assembly language into the Microsoft implementation of the Common Object File Format (COFF). The linker can link COFF code with object code that is produced by the ARM assembler or by the C compiler, together with object libraries that are created by the librarian.
36+
37+
## Syntax
38+
39+
```
40+
armasm [[options]] sourcefile objectfile
41+
```
42+
43+
```
44+
armasm [[options]] -o objectfile sourcefile
45+
```
46+
47+
#### Parameters
48+
`options`
49+
-errors `filename`
50+
Redirect error and warning messages to `filename`.
51+
52+
-i `dir[;dir]`
53+
Add the specified directories to the include search path.
54+
55+
-predefine `directive`
56+
Specify a SETA, SETL, or SETS directive to predefine a symbol. Example: **armasm.exe -predefine "COUNT SETA 150" source.asm**. For more information, see the [ARM assembler tools guide](http://go.microsoft.com/fwlink/?LinkId=246102).
57+
58+
-nowarn
59+
Disable all warning messages.
60+
61+
-ignore `warning`
62+
Disable the specified warning. For possible values, see the section about warnings.
63+
64+
-help
65+
Print the command-line help message.
66+
67+
-machine `machine`
68+
Specify the machine type to set in the PE header. Possible values for `machine` are:
69+
**ARM**—Sets the machine type to IMAGE_FILE_MACHINE_ARMNT. This is the default.
70+
**THUMB**—Sets the machine type to IMAGE_FILE_MACHINE_THUMB.
71+
72+
-oldit
73+
Generate ARMv7-style IT blocks. By default, ARMv8-compatible IT blocks are generated.
74+
75+
-via `filename`
76+
Read additional command-line arguments from `filename`.
77+
78+
-16
79+
Assemble source as 16-bit Thumb instructions. This is the default.
80+
81+
-32
82+
Assemble source as 32-bit ARM instructions.
83+
84+
-g
85+
Generate debugging information.
86+
87+
-errorReport: `option`
88+
Specify how internal assembler errors are reported to Microsoft. Possible values for `option` are:
89+
**none**—Do not send reports.
90+
**prompt**—Prompt the user to send reports immediately.
91+
**queue**—Prompt the user to send reports at the next admin logon. This is the default.
92+
**send**—Send reports automatically.
93+
94+
`sourcefile`
95+
The name of the source file.
96+
97+
`objectfile`
98+
The name of the object (output) file.
99+
100+
The following example demonstrates how to use armasm in a typical scenario. First, use armasm to build an assembly language source (.asm) file to an object (.obj) file. Then, use the CL command-line C compiler to compile a source (.c) file, and also specify the linker option to link the ARM object file.
101+
102+
**armasm myasmcode.asm -o myasmcode.obj**
103+
104+
**cl myccode.c /link myasmcode.obj**
105+
106+
## See Also
107+
[ARM Assembler Diagnostic Messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)
108+
[ARM Assembler Directives](../../assembler/arm/arm-assembler-directives.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: "ARM Assembler Diagnostic Messages"
3+
ms.custom: ""
4+
ms.date: "10/28/2016"
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: 6
16+
author: "corob-msft"
17+
ms.author: "corob"
18+
manager: "ghogen"
19+
translation.priority.ht:
20+
- "cs-cz"
21+
- "de-de"
22+
- "es-es"
23+
- "fr-fr"
24+
- "it-it"
25+
- "ja-jp"
26+
- "ko-kr"
27+
- "pl-pl"
28+
- "pt-br"
29+
- "ru-ru"
30+
- "tr-tr"
31+
- "zh-cn"
32+
- "zh-tw"
33+
---
34+
# ARM Assembler Diagnostic Messages
35+
The Microsoft ARM assembler (*armasm*) emits diagnostic warnings and errors when it encounters them. This article describes the most commonly-encountered messages.
36+
37+
## Syntax
38+
39+
```
40+
41+
filename(lineno) : [error|warning] Anum: message
42+
```
43+
44+
## Diagnostic Messages
45+
46+
### Errors
47+
A2193: this instruction generates unpredictable behavior
48+
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).
49+
50+
```
51+
52+
ADD r0, r8, pc ; A2193: this instruction generates unpredictable behavior
53+
54+
```
55+
56+
A2196: instruction cannot be encoded in 16 bits
57+
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.
58+
59+
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.
60+
61+
```
62+
63+
ADD.N r0, r1, r2 ; A2196: instruction cannot be encoded in 16 bits
64+
65+
B.W label ; OK
66+
B.N label ; A2196: instruction cannot be encoded in 16 bits
67+
SPACE 10000
68+
label
69+
70+
```
71+
72+
A2202: Pre-UAL instruction syntax not allowed in THUMB region
73+
Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax is no longer accepted
74+
75+
```
76+
77+
ADDEQS r0, r1 ; A2202: Pre-UAL instruction syntax not allowed in THUMB region
78+
ADDSEQ r0, r1 ; OK
79+
80+
```
81+
82+
A2513: Rotation must be even
83+
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.
84+
85+
```
86+
87+
MOV r0, #4, #2 ; OK
88+
MOV r0, #4, #1 ; A2513: Rotation must be even
89+
90+
```
91+
92+
A2557: Incorrect number of bytes to write back
93+
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.
94+
95+
```
96+
97+
VLD1.8 {d0-d3}, [r0]! ; OK
98+
VLD1.8 {d0-d3}, [r0], #32 ; OK
99+
VLD1.8 {d0-d3}, [r0], #100 ; A2557: Incorrect number of bytes to write back
100+
101+
```
102+
103+
### Warnings
104+
A4228: Alignment value exceeds AREA alignment; alignment not guaranteed
105+
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.
106+
107+
To fix this, you can specify on the `AREA` directive an `ALIGN` attribute that is equal to or greater than the desired alignment.
108+
109+
```
110+
111+
AREA |.myarea1|
112+
ALIGN 8 ; A4228: Alignment value exceeds AREA alignment; alignment not guaranteed
113+
114+
AREA |.myarea2|,ALIGN=3
115+
ALIGN 8 ; OK
116+
117+
```
118+
119+
A4508: Use of this rotated constant is deprecated
120+
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.
121+
122+
```
123+
124+
ANDS r0, r0, #1 ; OK
125+
ANDS r0, r0, #4, #2 ; A4508: Use of this rotated constant is deprecated
126+
127+
```
128+
129+
A4509: This form of conditional instruction is deprecated
130+
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).
131+
132+
This warning is not emitted when the `-oldit` command-line switch is used.
133+
134+
```
135+
136+
ADDEQ r0, r1, r8 ; A4509: This form of conditional instruction is deprecated
137+
138+
```
139+
140+
## See Also
141+
[ARM Assembler Command-Line Reference](../../assembler/arm/arm-assembler-command-line-reference.md)
142+
[ARM Assembler Directives](../../assembler/arm/arm-assembler-directives.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: "ARM Assembler Directives"
3+
ms.custom: ""
4+
ms.date: "10/28/2016"
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: 9cfa8896-ec10-4e77-855a-3135c40d7d2a
15+
caps.latest.revision: 5
16+
author: "corob-msft"
17+
ms.author: "corob"
18+
manager: "ghogen"
19+
translation.priority.ht:
20+
- "cs-cz"
21+
- "de-de"
22+
- "es-es"
23+
- "fr-fr"
24+
- "it-it"
25+
- "ja-jp"
26+
- "ko-kr"
27+
- "pl-pl"
28+
- "pt-br"
29+
- "ru-ru"
30+
- "tr-tr"
31+
- "zh-cn"
32+
- "zh-tw"
33+
---
34+
# ARM Assembler Directives
35+
For the most part, the Microsoft ARM assembler uses the ARM assembly language, which is documented in Chapter 7 of the [ARM assembler tools guide](http://go.microsoft.com/fwlink/?LinkId=246102). However, the Microsoft implementations of some assembly directives differ from the ARM assembly directives. This article explains the differences.
36+
37+
## Microsoft Implementations of ARM Assembly Directives
38+
AREA
39+
The Microsoft ARM assembler supports these AREA attributes: ALIGN, CODE, CODEALIGN, DATA, NOINIT, READONLY, READWRITE, THUMB, ARM.
40+
41+
All except THUMB and ARM work as documented in the [ARM assembler tools guide](http://go.microsoft.com/fwlink/?LinkId=246102).
42+
43+
In the Microsoft ARM assembler, THUMB indicates that a CODE section contains Thumb code, and is the default for CODE sections. ARM indicates that the section contains ARM code.
44+
45+
ATTR
46+
Not supported.
47+
48+
CODE16
49+
Not supported because it implies pre-UAL Thumb syntax, which the Microsoft ARM assembler does not allow. Use the THUMB directive instead, along with UAL syntax.
50+
51+
COMMON
52+
Specification of an alignment for the common region is not supported.
53+
54+
DCDO
55+
Not supported.
56+
57+
DN, QN, SN
58+
Specification of a type or a lane on the register alias is not supported.
59+
60+
ENTRY
61+
Not supported.
62+
63+
EQU
64+
Specification of a type for the defined symbol is not supported.
65+
66+
EXPORT and GLOBAL
67+
```
68+
EXPORTsym {[type]}
69+
```
70+
71+
`sym` is the symbol to be exported. `[type]`, if specified, can be either `[DATA]` to indicate that the symbol points to data or `[FUNC]` to indicate that the symbol points to code.
72+
73+
GLOBAL is a synonym for EXPORT.
74+
75+
EXPORTAS
76+
Not supported.
77+
78+
FRAME
79+
Not supported.
80+
81+
FUNCTION and PROC
82+
Although the assembly syntax supports the specification of a custom calling convention on procedures by listing the registers that are caller-save and those that are callee-save, the Microsoft ARM assembler accepts the syntax but ignores the register lists. The debug information that is produced by the assembler supports only the default calling convention.
83+
84+
IMPORT and EXTERN
85+
```
86+
IMPORT sym{, WEAK alias{, TYPE t}}
87+
```
88+
89+
`sym` is the name of the symbol to be imported.
90+
91+
If WEAK `alias` is specified, it indicates that `sym` is a weak external. If no definition for it is found at link time, then all references to it bind instead to `alias`.
92+
93+
If TYPE `t` is specified, then `t` indicates how the linker should attempt to resolve `sym`. These values for `t` are possible:
94+
1—Do not perform a library search for `sym`
95+
2—Perform a library search for `sym`
96+
3—`sym` is an alias for `alias` (default)
97+
98+
EXTERN is a synonym for IMPORT, except that `sym` is imported only if there are references to it in the current assembly.
99+
100+
MACRO
101+
The use of a variable to hold the condition code of a macro is not supported. Default values for macro parameters are not supported.
102+
103+
NOFP
104+
Not supported.
105+
106+
OPT, TTL, SUBT
107+
Not supported because the Microsoft ARM assembler does not produce listings.
108+
109+
PRESERVE8
110+
Not supported.
111+
112+
RELOC
113+
`RELOC n` can only follow an instruction or a data definition directive. There is no "anonymous symbol" that can be relocated.
114+
115+
REQUIRE
116+
Not supported.
117+
118+
REQUIRE8
119+
Not supported.
120+
121+
THUMBX
122+
Not supported because the Microsoft ARM assembler does not support the Thumb-2EE instruction set.
123+
124+
## See Also
125+
[ARM Assembler Command-Line Reference](../../assembler/arm/arm-assembler-command-line-reference.md)
126+
[ARM Assembler Diagnostic Messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)

0 commit comments

Comments
 (0)