You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add _chkstk to list of internals
* Fixes for command line issues
* Minor tweak
* Update random.md (#322)
Fix broken fwlink to presentation on rand
* Update link names and instructions
* More link fixes, consolidation
* Another tweak
* Update x64 topics, topic names
* Fix C3861 issues.
* Fix link issues.
* Dang typoes.
* Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (MicrosoftDocs#323)
* Update random.md
Fix broken fwlink to presentation on rand
* Update arm-assembler-reference.md
Point to search engine to pick up latest results for ARM references on the ARM Developer Center.
* Update some egregious out-of-dateness
* Fix a link typo.
* Update to address user complaints
* Minor tweaks.
* Remove stray parens.
* updated info on mbcs dll (MicrosoftDocs#325)
* Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (MicrosoftDocs#326)
* Update random.md
Fix broken fwlink to presentation on rand
* Update arm-assembler-reference.md
Point to search engine to pick up latest results for ARM references on the ARM Developer Center.
* Update desktop-applications-visual-cpp.md
Fix space issue
* Fix some C1083 user complaints (MicrosoftDocs#332)
* First draft of fixes for user complaints
* More updates for common issues
* More consistency tweaks
* Fix link typo
* Make C2065 friendlier (#333)
* Try to address some user issues.
* Add a useful link.
* Updated namespaces topic (#329)
* updated namespaces topic
* udpated ms.date
* Updated content on MFC MBCS DLL (MicrosoftDocs#328)
* updated info on mbcs dll
* minor tweak
* udpated ms.date
* Update ms.date to match changes.
* Update more freshness dates
* Escape brackets, fix format
* Update .openpublishing.publish.config.json with pdf info (#336)
* Update .openpublishing.publish.config.json
* Update .openpublishing.publish.config.json
* Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (#335)
* Update random.md
Fix broken fwlink to presentation on rand
* Update arm-assembler-reference.md
Point to search engine to pick up latest results for ARM references on the ARM Developer Center.
* Update desktop-applications-visual-cpp.md
Fix space issue
* 📦 Enable PDF generation.
* zc-conformance.md: rvalueCast is off by default
rvalueCast is off by default according to the https://docs.microsoft.com/en-us/cpp/build/reference/zc-rvaluecast-enforce-type-conversion-rules
* Fix bad merge in storage-classes-cpp
Had merge conflict markers
* Update .openpublishing.publish.config.json
* Fix typographical error
The fix is for the file docs/windows/desktop-applications-visual-cpp.md
and adds the missing word "that" to a sentence.
* Correct .ERRDIF[[I]] title
* Fixed indentation
* Replace nonsense with correct statement
Replace nonsense with correct statement
* Update read.md
Fix some more formatting while we're at it.
* Correct build working directory
* Order link option alphabetically
Orders link option CLRUNMANAGEDCODECHECK alphabetically
in the table of contents for consistency.
* Updating timestamp
Worth getting this right, since otherwise it doesn't look like this page covers 15.3 (and it does!)
* Update cl-environment-variables.md
Line 65, fixed spelling of "setting".
* Update CONTRIBUTING.md
* Resolve syncing conflicts from FromPublicMasterBranch to master (#340)
* Update random.md
Fix broken fwlink to presentation on rand
* Update arm-assembler-reference.md
Point to search engine to pick up latest results for ARM references on the ARM Developer Center.
* Update desktop-applications-visual-cpp.md
Fix space issue
* 📦 Enable PDF generation.
* zc-conformance.md: rvalueCast is off by default
rvalueCast is off by default according to the https://docs.microsoft.com/en-us/cpp/build/reference/zc-rvaluecast-enforce-type-conversion-rules
* Fix bad merge in storage-classes-cpp
Had merge conflict markers
* Update .openpublishing.publish.config.json
* Fix typographical error
The fix is for the file docs/windows/desktop-applications-visual-cpp.md
and adds the missing word "that" to a sentence.
* Correct .ERRDIF[[I]] title
* Fixed indentation
* Replace nonsense with correct statement
Replace nonsense with correct statement
* Update read.md
Fix some more formatting while we're at it.
* Correct build working directory
* Order link option alphabetically
Orders link option CLRUNMANAGEDCODECHECK alphabetically
in the table of contents for consistency.
* Updating timestamp
Worth getting this right, since otherwise it doesn't look like this page covers 15.3 (and it does!)
* Update cl-environment-variables.md
Line 65, fixed spelling of "setting".
* Update CONTRIBUTING.md
Copy file name to clipboardExpand all lines: docs/assembler/arm/arm-assembler-reference.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "ARM Assembler Reference | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/04/2016"
4
+
ms.date: "08/28/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.technology:
@@ -31,6 +31,7 @@ translation.priority.ht:
31
31
- "zh-tw"
32
32
---
33
33
# ARM Assembler Reference
34
+
34
35
The articles in this section of the documentation provide reference material for the Microsoft ARM assembler (armasm) and related tools.
35
36
36
37
## Related Articles
@@ -44,5 +45,6 @@ The articles in this section of the documentation provide reference material for
44
45
|[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. **Note:** The "armasm" assembler that is referred to on the ARM Developer website is not the Microsoft armasm assembler that is included in Visual Studio and is documented in this section.|
Copy file name to clipboardExpand all lines: docs/assembler/masm/masm-for-x64-ml64-exe.md
+37-14
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,9 @@ ms.topic: "article"
11
11
dev_langs:
12
12
- "C++"
13
13
helpviewer_keywords:
14
+
- "ml64"
14
15
- "ml64.exe"
15
-
- "ml"
16
+
- "masm for x64"
16
17
ms.assetid: 89059103-f372-4968-80ea-0c7f90bb9c91
17
18
caps.latest.revision: 12
18
19
author: "corob-msft"
@@ -34,14 +35,34 @@ translation.priority.ht:
34
35
- "zh-tw"
35
36
---
36
37
# MASM for x64 (ml64.exe)
37
-
ml64.exe is the assembler that accepts x64 assembly language. For information on ml64.exe compiler options, see [ML and ML64 Command-Line Reference](../../assembler/masm/ml-and-ml64-command-line-reference.md).
38
-
39
-
Inline ASM is not supported for x64. Use MASM or compiler intrinsics ([x64 (amd64) Intrinsics List](../../intrinsics/x64-amd64-intrinsics-list.md)).
40
-
41
-
The two workarounds are separate assembly with MASM (which supports x64 fully) and compiler intrinsics. We’ve added a lot of intrinsics to allow customers to make use of special-function instructions (e.g. privileged, bit scan/test, interlocked, etc.) in as close to cross-platform a manner as possible.
38
+
39
+
Visual Studio includes both 32-bit and 64-bit hosted versions of MASM to target x64 code. Named ml64.exe, this is the assembler that accepts x64 assembler language. The MASM command-line tools are installed when you choose a C++ workload during Visual Studio installation. These tools are not available as a separate download. To download and install a copy of Visual Studio, see [https://www.visualstudio.com/](https://www.visualstudio.com/). If you do not want to install the Visual Studio IDE, but only want the command-line tools, see the **Build Tools for Visual Studio 2017** option on the [Visual Studio Downloads](https://www.visualstudio.com/downloads/) page.
40
+
41
+
To use MASM to build code for x64 targets on the command line, you must use a developer command prompt for x64 targets, which sets the required path and other environment variables. For information on how to start a developer command prompt, see [Build C/C++ code on the command line](../../build/building-on-the-command-line.md).
42
+
43
+
For information on ml64.exe command line options, see [ML and ML64 Command-Line Reference](../../assembler/masm/ml-and-ml64-command-line-reference.md).
44
+
45
+
Inline assembler or use of the ASM keyword is not supported for x64 or ARM targets. To port your x86 code that uses inline assembler to x64 or ARM, you can convert your code to C++, use compiler intrinsics, or create assembler-language source files. The Visual C++ compiler supports intrinsics to allow you to use special-function instructions, for example, privileged, bit scan/test, interlocked, and so on, in as close to a cross-platform manner as possible. For information on available intrinsics, see [Compiler Intrinsics](../../intrinsics/compiler-intrinsics.md).
46
+
47
+
## Add an assembler-language file to a Visual C++ project
48
+
49
+
The Visual Studio project system supports assembler-language files built by using MASM in your C++ projects. You can create x64 assembler-language source files and build them into object files by using MASM, which supports x64 fully. You can then link these object files to your C++ code built for x64 targets. This is one way to overcome the lack of an x64 inline assembler.
50
+
51
+
### To add an assembler-language file to an existing Visual C++ project
52
+
53
+
1. Select the project in **Solution Explorer**. On the menu bar, choose **Project**, **Build Customizations**.
54
+
55
+
1. In the **Visual C++ Build Customization Files** dialog box, check the checkbox next to **masm(.targets,.props)**. Choose **OK** to save your selection and close the dialog box.
56
+
57
+
1. On the menu bar, choose **Project**, **Add New Item**.
58
+
59
+
1. In the **Add New Item** dialog box, select **C++ file (.cpp)** in the center pane. In the **Name** edit control, enter a new file name that has a **.asm** extension instead of .cpp. Choose **Add** to add the file to your project and close the dialog box.
60
+
61
+
Create your assembler-language code in the .asm file you added. When you build your solution, the MASM assembler is invoked to assemble the .asm file into an object file that is then linked into your project. To make symbol access easier, declare your assembler functions as `extern "C"` in your C++ source code, rather than using the C++ name decoration conventions in your assembler-language source files.
42
62
43
63
## ml64-Specific Directives
44
-
Use the following directives with ml64.exe:
64
+
65
+
You can use the following ml64-specific directives in your assembler-language source code that targets x64:
In addition, the [PROC](../../assembler/masm/proc.md) directive was updated for use with ml64.exe.
81
+
In addition, the [PROC](../../assembler/masm/proc.md) directive has been updated for use with ml64.exe.
61
82
62
83
## 32-Bit Address Mode (Address Size Override)
63
-
MASM will emit the 0x67 address size override if a memory operand includes 32-bit registers. For example, the following examples cause the address size override to be emitted:
84
+
85
+
MASM emits the 0x67 address size override if a memory operand includes 32-bit registers. For example, the following examples cause the address size override to be emitted:
64
86
65
-
```
87
+
```MASM
66
88
mov rax, QWORD PTR [ecx]
67
89
mov eax, DWORD PTR [ecx*2+r10d]
68
90
mov eax, DWORD PTR [ecx*2+r10d+0100h]
69
91
prefetch [eax]
70
92
movnti rax, QWORD PTR [r8d]
71
93
```
72
94
73
-
MASM assumes that if a 32-bit displacement appears alone as a memory operand, 64-bit addressing is intended. There is currently no support for 32-bit addressing with such operands.
95
+
MASM assumes that if a 32-bit displacement appears alone as a memory operand, 64-bit addressing is intended. There is currently no support for 32-bit addressing with such operands.
74
96
75
-
Finally, mixing register sizes within a memory operand, as demonstrated in the following code, will generate an error.
97
+
Finally, mixing register sizes within a memory operand, as demonstrated in the following code, generates an error.
0 commit comments