Skip to content

Commit 82fb345

Browse files
TaojunshenColin Robertsonopbld17pritamsolaurenprinn
authored
5/10/2022 AM Publish (#4270)
* Broken link fixed * Broken link fixed * Update dynamicbase.md arm32 and arm64 is not supported for this linker switch as ASLR cannot be disabled for these architectures. * update code examples * offer an alternative project type * fix for github #3859 * acrolinx * Clarify per Russ' comments Also update date and add formatting to current standard. * Work in progress for 17.2 release * Followup cpp-docs 3871 in linker opts * Fix grammar and formatting issues * Update latest-supported-vc-redist.md In the line 35, at the very end removed an extra dot. * Fix alarming bidi description * text tweaks * Address cpp-docs 3857 3865 3877 3882 Co-authored-by: Colin Robertson <corob@microsoft.com> Co-authored-by: opbld17 <opbld17@microsoft.com> Co-authored-by: Pritam Ovhal <31490724+pritamso@users.noreply.github.com> Co-authored-by: Lauren Prinn <laurenprinn98@gmail.com> Co-authored-by: PRMerger16 <prmrgr16@microsoft.com> Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: PRMerger4 <prmergr4@microsoft.com> Co-authored-by: Tamara K <93546702+tamarakhader@users.noreply.github.com> Co-authored-by: Matin Sasanpour <matin.sasan@gmail.com> Co-authored-by: Courtney Wales <62625502+Court72@users.noreply.github.com> Co-authored-by: Dennis Rea <v-denrea@microsoft.com> Co-authored-by: Colin Cooper <72402153+v-ccolin@users.noreply.github.com> Co-authored-by: Carolyn McSharry <v-cmcsharry@microsoft.com>
1 parent 9869bcf commit 82fb345

7 files changed

Lines changed: 388 additions & 190 deletions

docs/assembler/arm/arm-assembler-command-line-reference.md

Lines changed: 74 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,120 @@
11
---
22
title: "ARM Assembler command-line reference"
33
description: "Reference guide to the Microsoft ARM assembler command-line options."
4-
ms.date: "02/09/2020"
4+
ms.date: 05/09/2022
55
ms.assetid: f7b89478-1ab5-4995-8cde-a805f0462c45
66
---
77
# ARM Assembler command-line reference
88

9-
This article provides command-line information about the Microsoft ARM assembler, **armasm**. **armasm** assembles ARMv7 Thumb assembly language into the Microsoft implementation of the Common Object File Format (COFF). The linker can link COFF code objects produced by both the ARM assembler and the C compiler. It can link either together with object libraries created by the librarian.
9+
The Microsoft ARM assemblers, **armasm** and **armasm64**, support several command-line options. By default, **armasm** assembles ARMv7 Thumb assembly language into the Microsoft implementation of the Common Object File Format (COFF). The **armasm64** assembler creates COFF object code for ARM64 and ARM64EC targets. The linker can link COFF code objects produced by both the ARM assembler and the C/C++ compiler. It can link either together with object libraries created by the librarian.
1010

1111
## Syntax
1212

1313
> **`armasm`** [*options*] *source_file* *object_file*\
14-
> **`armasm`** [*options*] **`-o`** *object_file* *source_file*
14+
> **`armasm`** [*options*] *source_file*
15+
16+
> **`armasm64`** [*options*] *source_file* *object_file*\
17+
> **`armasm64`** [*options*] *source_file*
1518
1619
### Parameters
1720

1821
*options*\
1922
A combination of zero or more of the following options:
2023

24+
- **`-16`**\
25+
Available only in **armasm**. Assemble source as 16-bit Thumb instructions. This option is the default.
26+
27+
- **`-32`**\
28+
Available only in **armasm**. Assemble source as 32-bit ARM instructions.
29+
30+
- **`-coff_thumb2_only`**\
31+
Available only in **armasm**. Allow only Thumb-2 code.
32+
33+
- **`-errorReport:`** *option*\
34+
This option is deprecated. In Windows Vista and later, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
35+
2136
- **`-errors`** *filename*\
22-
Redirect error and warning messages to *filename*.
37+
**`-e`** *filename*\
38+
Redirect error and warning messages to *filename*. By default, these messages are sent to `stdout`.
2339

24-
- **`-i`** *dir*[**`;`**<em>dir</em>]\
25-
Add the specified directories to the include search path.
40+
- **`-funcOverride:`** *function_name*\
41+
Available only in **armasm64**. Emit function overriding support for *function_name*.
2642

27-
- **`-predefine`** *directive*\
28-
Specify a SETA, SETL, or SETS directive to predefine a symbol.\
29-
Example: `armasm.exe -predefine "COUNT SETA 150" source.asm`\
30-
For more information, see the [ARM Compiler armasm Reference Guide](https://developer.arm.com/documentation/dui0802/latest/).
43+
- **`-g`**\
44+
Generate debugging information.
3145

32-
- **`-nowarn`**\
33-
Disable all warning messages.
46+
- **`-gh:SHA1`**\
47+
Use the SHA-1 cryptographic hash algorithm to generate a checksum of each source file in debug info. Overrides **`-gh:SHA256`**.
3448

35-
- **`-ignore`** *warning*\
36-
Disable the specified warning. For possible values, see the section about warnings.
49+
- **`-gh:SHA256`**\
50+
Use the SHA-256 cryptographic hash algorithm to generate a checksum of each source file in debug info. This option is on by default in Visual Studio 2022 version 17.0 and later.
51+
52+
- **`-guard:ehcont`**[**`-`**]\
53+
Generate a sorted list of the relative virtual addresses (RVA) of all the valid exception handling continuation targets for a binary. It's used at runtime for `NtContinue` and `SetThreadContext` instruction pointer validation. By default, **`-guard:ehcont`** is off and must be explicitly enabled. To explicitly disable this option, use **`-guard:ehcont-`**. This option is available in Visual Studio 2019 version 16.7 and later. The feature is supported for 64-bit processes on a 64-bit OS.
3754

3855
- **`-help`**\
39-
Print the command-line help message.
56+
**`-h`**\
57+
Print the command-line help message.
58+
59+
- **`-i`** *dir*[**`;`** *dir*]\
60+
Add one or more specified directories to the include search path. Separate directories by using a semi-colon (`;`).
61+
62+
- **`-ignore`** *warning_number*\
63+
Disable the specified warning number. For possible values, see [ARM Assembler diagnostic messages](arm-assembler-diagnostic-messages.md).
64+
65+
- **`-list`** *list_file*\
66+
Create a detailed listing of the generated assembly language to *list_file*. The *list_file* parameter is optional. If it's omitted, the assembler appends *`.lst`* to the base name of *source_file* to create the listing file.
4067

4168
- **`-machine`** *machine*\
42-
Specify the machine type to set in the PE header. Possible values for *machine* are:\
43-
**ARM**—Sets the machine type to IMAGE_FILE_MACHINE_ARMNT. This option is the default.\
44-
**THUMB**—Sets the machine type to IMAGE_FILE_MACHINE_THUMB.
69+
Specify the machine type to set in the PE header. In **armasm**, possible values for *machine* are:
70+
- **ARM**—Sets the machine type to `IMAGE_FILE_MACHINE_ARMNT`. This option is the default.
71+
- **THUMB**—Sets the machine type to `IMAGE_FILE_MACHINE_THUMB`.
4572

46-
- **`-oldit`**\
47-
Generate ARMv7-style IT blocks. By default, ARMv8-compatible IT blocks are generated.
73+
In **armasm64**, possible values are:
74+
- **ARM64**—Sets the machine type to `IMAGE_FILE_MACHINE_ARM64`. This option is the default.
75+
- **ARM64EC**—Sets the machine type to `IMAGE_FILE_MACHINE_ARM64EC`.
4876

49-
- **`-via`** *filename*\
50-
Read additional command-line arguments from *filename*.
77+
- **`-noesc`**\
78+
**`-noe`**\
79+
Ignore C-style escaped special characters, such as `\n` or `\t`.
5180

52-
- **`-16`**\
53-
Assemble source as 16-bit Thumb instructions. This option is the default.
81+
- **`-nologo`**\
82+
Suppress the copyright banner.
5483

55-
- **`-32`**\
56-
Assemble source as 32-bit ARM instructions.
84+
- **`-nowarn`**\
85+
**`-now`**\
86+
Disable all warning messages.
5787

58-
- **`-g`**\
59-
Generate debugging information.
88+
- **`-o`** *object_file*\
89+
Specify the name of the object (output) file. The **`-o`** option is optional; you can instead specify an object file name as the last element of the command line.
6090

61-
- **`-errorReport:`** *option*\
62-
This option is deprecated. Starting in Windows Vista, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
91+
- **`-oldit`**\
92+
Available only in **armasm**. Generate ARMv7-style IT blocks. By default, ARMv8-compatible IT blocks are generated.
93+
94+
- **`-predefine`** *directive*\
95+
**`-pd`** *directive*\
96+
Specify a SETA, SETL, or SETS directive to predefine a symbol.\
97+
Example: `armasm.exe -predefine "COUNT SETA 150" source.asm`\
98+
For more information, see the [ARM Compiler armasm Reference Guide](https://developer.arm.com/documentation/dui0802/latest/).
99+
100+
- **`-sourcelink:`** *sourcelink_filename*\
101+
*sourcelink_filename* specifies a JSON-formatted configuration file that contains a simple mapping of local file paths to URLs for source files to display in the debugger. For more information on the format of this file, see [Source Link JSON Schema](https://github.com/dotnet/designs/blob/master/accepted/2020/diagnostics/source-link.md#source-link-json-schema). Source Link is a language- and source-control agnostic system for providing source debugging for binaries. Source Link is supported for native binaries starting in Visual Studio 2017 version 15.8. For an overview of Source Link, see [Source Link](https://github.com/dotnet/designs/blob/master/accepted/2020/diagnostics/source-link.md). For information on how to use Source Link in your projects, and how to generate the SourceLink file as part of your project, see [Using Source Link](https://github.com/dotnet/sourcelink#using-source-link-in-c-projects).
102+
103+
- **`-via`** *filename*\
104+
Read extra command-line arguments from *filename*.
63105

64106
*source_file*\
65107
The name of the source file.
66108

67109
*object_file*\
68-
The name of the object (output) file.
110+
The last element of the command line can specify the name of the object (output) file. If it's omitted, and no **`-o`** option is specified, the assembler appends *`.obj`* to the base name of *source_file* to create the object file.
69111

70112
## Remarks
71113

72114
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.
73115

74116
```cmd
75-
armasm myasmcode.asm -o myasmcode.obj
117+
armasm -o myasmcode.obj myasmcode.asm
76118
cl myccode.c /link myasmcode.obj
77119
```
78120

docs/assembler/arm/arm-assembler-diagnostic-messages.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
---
22
description: "Learn more about: ARM Assembler diagnostic messages"
33
title: "ARM Assembler diagnostic messages"
4-
ms.date: "08/30/2018"
4+
ms.date: 05/09/2022
55
f1_keywords: ["A2193", "A2196", "A2202", "A2513", "A2557", "A4228", "A4508", "A4509"]
66
helpviewer_keywords: ["A2193", "A2196", "A2202", "A2513", "A2557", "A4228", "A4508", "A4509"]
77
ms.assetid: 52b38267-6023-4bdc-a0ef-863362f48eec
88
---
99
# ARM Assembler diagnostic messages
1010

11-
The Microsoft ARM assembler (*armasm*) emits diagnostic warnings and errors when it encounters them. This article describes the most commonly-encountered messages.
11+
The Microsoft ARM assemblers, **armasm** and **armasm64**, emit diagnostic warnings and errors when they encounter them. This article describes the most commonly encountered messages.
1212

1313
## Syntax
1414

15-
> <em>filename</em>**(**<em>line-number</em>**) :** \[**error**|**warning**] **A**<em>number</em>**:** *message*
15+
> *filename* **(** *line-number* **) :** \[**error**|**warning**] **A** *number* **:** *message*
1616
1717
## Diagnostic messages - Errors
1818

1919
> A2193: this instruction generates unpredictable behavior
2020
21-
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](https://go.microsoft.com/fwlink/p/?linkid=246464).
21+
The ARM architecture can't guarantee what happens when this instruction is executed. For details about the well-defined forms of this instruction, consult the [ARM Architecture Reference Manual](https://go.microsoft.com/fwlink/p/?linkid=246464).
2222

2323
```asm
2424
ADD r0, r8, pc ; A2193: this instruction generates unpredictable behavior
2525
```
2626

2727
> A2196: instruction cannot be encoded in 16 bits
2828
29-
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.
29+
The specified instruction can't 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.
3030

3131
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.
3232

3333
```asm
34-
ADD.N r0, r1, r2 ; A2196: instruction cannot be encoded in 16 bits
34+
ADD.N r0, r1, r2 ; A2196: instruction can't be encoded in 16 bits
3535
3636
B.W label ; OK
37-
B.N label ; A2196: instruction cannot be encoded in 16 bits
37+
B.N label ; A2196: instruction can't be encoded in 16 bits
3838
SPACE 10000
3939
label
4040
```
4141

4242
> A2202: Pre-UAL instruction syntax not allowed in THUMB region
4343
44-
Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax is no longer accepted
44+
Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax is no longer accepted
4545

4646
```asm
4747
ADDEQS r0, r1 ; A2202: Pre-UAL instruction syntax not allowed in THUMB region
@@ -50,7 +50,7 @@ Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax
5050

5151
> A2513: Rotation must be even
5252
53-
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.
53+
In ARM mode, there's an alternate syntax for specifying constants. Instead of writing `#<const>`, you can write `#<byte>,#<rot>`, which represents the constant value that's obtained by rotating the value `<byte>` right by `<rot>`. When you use this syntax, you must make the value of `<rot>` even.
5454

5555
```asm
5656
MOV r0, #4, #2 ; OK
@@ -59,7 +59,7 @@ In ARM mode, there is an alternate syntax for specifying constants. Instead of
5959

6060
> A2557: Incorrect number of bytes to write back
6161
62-
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.
62+
On the NEON structure load and store instructions (`VLDn`, `VSTn`), there's 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.
6363

6464
```asm
6565
VLD1.8 {d0-d3}, [r0]! ; OK
@@ -71,9 +71,9 @@ On the NEON structure load and store instructions (`VLDn`, `VSTn`), there is an
7171

7272
> A4228: Alignment value exceeds AREA alignment; alignment not guaranteed
7373
74-
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.
74+
The alignment that's specified in an `ALIGN` directive is greater than the alignment of the enclosing `AREA`. As a result, the assembler can't guarantee that the `ALIGN` directive will be honored.
7575

76-
To fix this, you can specify on the `AREA` directive an `ALIGN` attribute that is equal to or greater than the desired alignment.
76+
To fix this warning, you can specify on the `AREA` directive an `ALIGN` attribute that's equal to or greater than the desired alignment.
7777

7878
```asm
7979
AREA |.myarea1|
@@ -85,7 +85,7 @@ ALIGN 8 ; OK
8585

8686
> A4508: Use of this rotated constant is deprecated
8787
88-
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.
88+
In ARM mode, there's an alternate syntax for specifying constants. Instead of writing `#<const>`, you can write `#<byte>,#<rot>`, which represents the constant value that's 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.
8989

9090
```asm
9191
ANDS r0, r0, #1 ; OK
@@ -96,7 +96,7 @@ In ARM mode, there is an alternate syntax for specifying constants. Instead of
9696
9797
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](https://go.microsoft.com/fwlink/p/?linkid=246464).
9898

99-
This warning is not emitted when the **-oldit** command-line switch is used.
99+
This warning isn't emitted when the **`-oldit`** command-line switch is used.
100100

101101
```asm
102102
ADDEQ r0, r1, r8 ; A4509: This form of conditional instruction is deprecated

docs/assembler/arm/arm-assembler-reference.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
description: "Learn more about: ARM Assembler Reference"
3-
title: "ARM Assembler Reference"
4-
ms.date: "08/28/2017"
2+
description: "Learn more about: ARM Assembler reference"
3+
title: "ARM Assembler reference"
4+
ms.date: 05/09/2022
55
ms.assetid: f8a076cc-9627-4328-a34a-9c44f7a3aab1
66
---
7-
# ARM Assembler Reference
7+
# ARM Assembler reference
88

9-
The articles in this section of the documentation provide reference material for the Microsoft ARM assembler (armasm) and related tools.
9+
The articles in this section of the documentation provide reference material for the Microsoft ARM assembler (**armasm** or **armasm64**) and related tools.
1010

11-
## Related Articles
11+
## Related articles
1212

1313
|Title|Description|
1414
|-----------|-----------------|
15-
|[ARM Assembler Command-Line Reference](../../assembler/arm/arm-assembler-command-line-reference.md)|Describes the armasm command-line options.|
16-
|[ARM Assembler Diagnostic Messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)|Describes commonly seen armasm warning and error messages.|
17-
|[ARM Assembler Directives](../../assembler/arm/arm-assembler-directives.md)|Describes the ARM directives that are different in armasm.|
15+
|[ARM Assembler command-line reference](../../assembler/arm/arm-assembler-command-line-reference.md)|Describes the Microsoft armasm and armasm64 command-line options.|
16+
|[ARM Assembler diagnostic messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)|Describes commonly seen armasm and armasm64 warning and error messages.|
17+
|[ARM Assembler directives](../../assembler/arm/arm-assembler-directives.md)|Describes the ARM directives that are different in Microsoft armasm and armasm64.|
1818
|[ARM Architecture Reference Manual](https://developer.arm.com/search#q=ARM%20Architecture%20Reference%20Manual) on the ARM Developer website.|Choose the relevant manual for your ARM architecture. Each contains reference sections about ARM, Thumb, NEON, and VFP, and additional information about the ARM assembly language.|
1919
|[ARM Compiler armasm User Guide](https://developer.arm.com/search#q=ARM%20Compiler%20armasm%20User%20Guide) on the ARM Developer website.|Choose a recent version to find up-to-date information about the ARM assembly language.|
2020

0 commit comments

Comments
 (0)