Skip to content

Commit 416ddab

Browse files
author
Colin Robertson
committed
Fix the rest of the formatting and whitespace issues
1 parent e8a66d4 commit 416ddab

362 files changed

Lines changed: 4110 additions & 4102 deletions

File tree

Some content is hidden

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "ARM Assembler Command-Line Reference | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "reference"
77
dev_langs: ["C++"]
@@ -85,7 +85,7 @@ The following example demonstrates how to use armasm in a typical scenario. Firs
8585

8686
**cl myccode.c /link myasmcode.obj**
8787

88-
## See Also
88+
## See also
8989

9090
[ARM Assembler Diagnostic Messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)<br/>
9191
[ARM Assembler Directives](../../assembler/arm/arm-assembler-directives.md)<br/>

docs/assembler/arm/arm-assembler-directives.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "ARM Assembler Directives | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "reference"
77
dev_langs: ["C++"]
@@ -100,7 +100,7 @@ Not supported.
100100
`THUMBX`<br/>
101101
Not supported because the Microsoft ARM assembler does not support the Thumb-2EE instruction set.
102102

103-
## See Also
103+
## See also
104104

105105
[ARM Assembler Command-Line Reference](../../assembler/arm/arm-assembler-command-line-reference.md)<br/>
106106
[ARM Assembler Diagnostic Messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)<br/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The articles in this section of the documentation provide reference material for
2424
|[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.|
2525
|[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.|
2626

27-
## See Also
27+
## See also
2828

2929
[ARM Intrinsics](../../intrinsics/arm-intrinsics.md)<br/>
3030
[Compiler Intrinsics](../../intrinsics/compiler-intrinsics.md)<br/>

docs/assembler/inline/accessing-c-or-cpp-data-in-asm-blocks.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Accessing C or C++ Data in __asm Blocks | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -12,10 +12,12 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Accessing C or C++ Data in __asm Blocks
15-
## Microsoft Specific
15+
16+
**Microsoft Specific**
17+
1618
A great convenience of inline assembly is the ability to refer to C or C++ variables by name. An `__asm` block can refer to any symbols, including variable names, that are in scope where the block appears. For instance, if the C variable `var` is in scope, the instruction
1719

18-
```
20+
```cpp
1921
__asm mov eax, var
2022
```
2123

@@ -25,14 +27,14 @@ If a class, structure, or union member has a unique name, an `__asm` block can r
2527

2628
If you declare variables with the types
2729

28-
```
30+
```cpp
2931
struct first_type hal;
3032
struct second_type oat;
3133
```
3234
3335
all references to the member `same_name` must use the variable name because `same_name` is not unique. But the member `weasel` has a unique name, so you can refer to it using only its member name:
3436
35-
```
37+
```cpp
3638
// InlineAssembler_Accessing_C_asm_Blocks.cpp
3739
// processor: x86
3840
#include <stdio.h>
@@ -69,5 +71,6 @@ You can access data members in C++ without regard to access restrictions. Howeve
6971

7072
**END Microsoft Specific**
7173

72-
## See Also
74+
## See also
75+
7376
[Using C or C++ in __asm Blocks](../../assembler/inline/using-c-or-cpp-in-asm-blocks.md)<br/>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Advantages of Inline Assembly | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -13,24 +13,24 @@ ms.workload: ["cplusplus"]
1313
---
1414
# Advantages of Inline Assembly
1515

16-
## Microsoft Specific
16+
**Microsoft Specific**
1717

1818
Because the inline assembler doesn't require separate assembly and link steps, it is more convenient than a separate assembler. Inline assembly code can use any C variable or function name that is in scope, so it is easy to integrate it with your program's C code. Because the assembly code can be mixed inline with C or C++ statements, it can do tasks that are cumbersome or impossible in C or C++.
1919

2020
The uses of inline assembly include:
2121

22-
- Writing functions in assembly language.
22+
- Writing functions in assembly language.
2323

24-
- Spot-optimizing speed-critical sections of code.
24+
- Spot-optimizing speed-critical sections of code.
2525

26-
- Making direct hardware access for device drivers.
26+
- Making direct hardware access for device drivers.
2727

28-
- Writing prolog and epilog code for "naked" calls.
28+
- Writing prolog and epilog code for "naked" calls.
2929

3030
Inline assembly is a special-purpose tool. If you plan to port an application to different machines, you'll probably want to place machine-specific code in a separate module. Because the inline assembler doesn't support all of Microsoft Macro Assembler's (MASM) macro and data directives, you may find it more convenient to use MASM for such modules.
3131

3232
**END Microsoft Specific**
3333

34-
## See Also
34+
## See also
3535

3636
[Inline Assembler](../../assembler/inline/inline-assembler.md)<br/>

docs/assembler/inline/asm.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "__asm | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "conceptual"
77
f1_keywords: ["__asm", "__asm_cpp"]
@@ -13,36 +13,33 @@ ms.author: "corob"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# __asm
16+
1617
**Microsoft Specific**
1718

1819
The `__asm` keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It cannot appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at the very least, an empty pair of braces. The term "`__asm` block" here refers to any instruction or group of instructions, whether or not in braces.
1920

2021
> [!NOTE]
21-
> Visual C++ support for the Standard C++ `asm` keyword is limited to the fact that the compiler will not generate an error on the keyword. However, an `asm` block will not generate any meaningful code. Use `__asm` instead of `asm`.
22-
23-
Syntax:
24-
25-
__asm *assembly-instruction* [ ; ]
26-
27-
__asm { *assembly-instruction-list* } [ ; ]
22+
> Visual C++ support for the Standard C++ `asm` keyword is limited to the fact that the compiler will not generate an error on the keyword. However, an `asm` block will not generate any meaningful code. Use `__asm` instead of `asm`.
2823
2924
## Grammar
30-
`__asm` `assembly-instruction` `;`opt
3125

32-
`__asm {` `assembly-instruction-list` `};`opt
26+
*asm-block*:<br/>
27+
&nbsp;&nbsp;&nbsp;&nbsp;**__asm** *assembly-instruction* **;**<sub>opt</sub><br/>
28+
&nbsp;&nbsp;&nbsp;&nbsp;**__asm {** *assembly-instruction-list* **}** **;**<sub>opt</sub>
3329

34-
*assembly-instruction-list*:
35-
`assembly-instruction` `;`opt
30+
*assembly-instruction-list*:<br/>
31+
&nbsp;&nbsp;&nbsp;&nbsp;*assembly-instruction* **;**<sub>opt</sub><br/>
32+
&nbsp;&nbsp;&nbsp;&nbsp;*assembly-instruction* **;** *assembly-instruction-list* **;**<sub>opt</sub>
3633

37-
`assembly-instruction` `;` `assembly-instruction-list` `;`opt
34+
## Remarks
3835

3936
If used without braces, the `__asm` keyword means that the rest of the line is an assembly-language statement. If used with braces, it means that each line between the braces is an assembly-language statement. For compatibility with previous versions, `_asm` is a synonym for `__asm`.
4037

4138
Since the `__asm` keyword is a statement separator, you can put assembly instructions on the same line.
4239

4340
Before Visual C++ 2005, the instruction
4441

45-
```
42+
```cpp
4643
__asm int 3
4744
```
4845

@@ -51,9 +48,10 @@ did not cause native code to be generated when compiled with **/clr**; the compi
5148
`__asm int 3` now results in native code generation for the function. If you want a function to cause a break point in your code and if you want that function compiled to MSIL, use [__debugbreak](../../intrinsics/debugbreak.md).
5249

5350
## Example
51+
5452
The following code fragment is a simple `__asm` block enclosed in braces:
5553

56-
```
54+
```cpp
5755
__asm {
5856
mov al, 2
5957
mov dx, 0xD007
@@ -63,15 +61,15 @@ __asm {
6361

6462
Alternatively, you can put `__asm` in front of each assembly instruction:
6563

66-
```
64+
```cpp
6765
__asm mov al, 2
6866
__asm mov dx, 0xD007
6967
__asm out dx, al
7068
```
7169

7270
Because the `__asm` keyword is a statement separator, you can also put assembly instructions on the same line:
7371

74-
```
72+
```cpp
7573
__asm mov al, 2 __asm mov dx, 0xD007 __asm out dx, al
7674
```
7775

@@ -81,6 +79,7 @@ Unlike braces in C and C++, the braces enclosing an `__asm` block don't affect v
8179

8280
**END Microsoft Specific**
8381

84-
## See Also
82+
## See also
83+
8584
[Keywords](../../cpp/keywords-cpp.md)<br/>
8685
[Inline Assembler](../../assembler/inline/inline-assembler.md)<br/>
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Assembly-Language Comments | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -12,16 +12,19 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Assembly-Language Comments
15-
## Microsoft Specific
15+
16+
**Microsoft Specific**
17+
1618
Instructions in an `__asm` block can use assembly-language comments:
1719

18-
```
20+
```cpp
1921
__asm mov ax, offset buff ; Load address of buff
2022
```
2123

2224
Because C macros expand into a single logical line, avoid using assembly-language comments in macros. (See [Defining __asm Blocks as C Macros](../../assembler/inline/defining-asm-blocks-as-c-macros.md).) An `__asm` block can also contain C-style comments; for more information, see [Using C or C++ in __asm Blocks](../../assembler/inline/using-c-or-cpp-in-asm-blocks.md).
2325

2426
**END Microsoft Specific**
2527

26-
## See Also
28+
## See also
29+
2730
[Using Assembly Language in __asm Blocks](../../assembler/inline/using-assembly-language-in-asm-blocks.md)<br/>

docs/assembler/inline/calling-c-functions-in-inline-assembly.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Calling C Functions in Inline Assembly | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -12,10 +12,12 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Calling C Functions in Inline Assembly
15-
## Microsoft Specific
15+
16+
**Microsoft Specific**
17+
1618
An `__asm` block can call C functions, including C library routines. The following example calls the `printf` library routine:
1719

18-
```
20+
```cpp
1921
// InlineAssembler_Calling_C_Functions_in_Inline_Assembly.cpp
2022
// processor: x86
2123
#include <stdio.h>
@@ -45,13 +47,14 @@ int main( void )
4547
4648
Because function arguments are passed on the stack, you simply push the needed arguments — string pointers, in the previous example — before calling the function. The arguments are pushed in reverse order, so they come off the stack in the desired order. To emulate the C statement
4749
48-
```
50+
```cpp
4951
printf( format, hello, world );
5052
```
5153

5254
the example pushes pointers to `world`, `hello`, and `format`, in that order, and then calls `printf`.
5355

5456
**END Microsoft Specific**
5557

56-
## See Also
58+
## See also
59+
5760
[Inline Assembler](../../assembler/inline/inline-assembler.md)<br/>
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Calling C++ Functions in Inline Assembly | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -12,12 +12,15 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Calling C++ Functions in Inline Assembly
15-
## Microsoft Specific
15+
16+
**Microsoft Specific**
17+
1618
An `__asm` block can call only global C++ functions that are not overloaded. If you call an overloaded global C++ function or a C++ member function, the compiler issues an error.
1719

1820
You can also call any functions declared with **extern "C"** linkage. This allows an `__asm` block within a C++ program to call the C library functions, because all the standard header files declare the library functions to have **extern "C"** linkage.
1921

2022
**END Microsoft Specific**
2123

22-
## See Also
24+
## See also
25+
2326
[Inline Assembler](../../assembler/inline/inline-assembler.md)<br/>
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Data Directives and Operators in Inline Assembly | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/30/2018"
55
ms.technology: ["cpp-masm"]
66
ms.topic: "conceptual"
77
dev_langs: ["C++"]
@@ -12,10 +12,13 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Data Directives and Operators in Inline Assembly
15-
## Microsoft Specific
15+
16+
**Microsoft Specific**
17+
1618
Although an `__asm` block can reference C or C++ data types and objects, it cannot define data objects with MASM directives or operators. Specifically, you cannot use the definition directives **DB**, `DW`, **DD**, `DQ`, `DT`, and `DF`, or the operators `DUP` or **THIS**. MASM structures and records are also unavailable. The inline assembler doesn't accept the directives `STRUC`, `RECORD`, **WIDTH**, or **MASK**.
1719

1820
**END Microsoft Specific**
1921

20-
## See Also
22+
## See also
23+
2124
[Using Assembly Language in __asm Blocks](../../assembler/inline/using-assembly-language-in-asm-blocks.md)<br/>

0 commit comments

Comments
 (0)