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
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.
13
+
The **`__asm`** keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It can't appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at minimum, an empty pair of braces. The term "**`__asm`** block" here refers to any instruction or group of instructions, whether or not in braces.
14
14
15
15
> [!NOTE]
16
16
> 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`**.
@@ -37,7 +37,7 @@ Before Visual Studio 2005, the instruction
37
37
__asm int3
38
38
```
39
39
40
-
did not cause native code to be generated when compiled with **/clr**; the compiler translated the instruction to a CLR break instruction.
40
+
didn't cause native code to be generated when compiled with **/clr**; the compiler translated the instruction to a CLR break instruction.
41
41
42
42
`__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).
43
43
@@ -69,9 +69,9 @@ Because the **`__asm`** keyword is a statement separator, you can also put assem
69
69
__asm mov al, 2 __asm mov dx, 0xD007 __asm out dx, al
70
70
```
71
71
72
-
All three examples generate the same code, but the first style (enclosing the **`__asm`** block in braces) has some advantages. The braces clearly separate assembly code from C or C++ code and avoid needless repetition of the **`__asm`** keyword. Braces can also prevent ambiguities. If you want to put a C or C++ statement on the same line as an **`__asm`** block, you must enclose the block in braces. Without the braces, the compiler cannot tell where assembly code stops and C or C++ statements begin. Finally, because the text in braces has the same format as ordinary MASM text, you can easily cut and paste text from existing MASM source files.
72
+
All three examples generate the same code, but the first style (enclosing the **`__asm`** block in braces) has some advantages. The braces clearly separate assembly code from C or C++ code and avoid needless repetition of the **`__asm`** keyword. Braces can also prevent ambiguities. If you want to put a C or C++ statement on the same line as an **`__asm`** block, you must enclose the block in braces. Without the braces, the compiler can't tell where assembly code stops and C or C++ statements begin. Finally, because the text in braces has the same format as ordinary MASM text, you can easily cut and paste text from existing MASM source files.
73
73
74
-
Unlike braces in C and C++, the braces enclosing an **`__asm`** block don't affect variable scope. You can also nest **`__asm`** blocks; nesting does not affect variable scope.
74
+
Unlike braces in C and C++, the braces enclosing an **`__asm`** block don't affect variable scope. You can also nest **`__asm`** blocks; nesting doesn't affect variable scope.
Copy file name to clipboardExpand all lines: docs/build/arm64-exception-handling.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "ARM64 exception handling"
3
3
description: Describes the exception handling conventions and data used by windows on ARM64.
4
-
ms.date: 10/10/2022
4
+
ms.date: 01/13/2023
5
5
---
6
6
# ARM64 exception handling
7
7
@@ -218,11 +218,11 @@ This data is broken into four sections:
218
218
219
219
2. If **E** is 1, then this field specifies the index of the first unwind code that describes the one and only epilog.
220
220
221
-
f. **Code Words** is a 5-bit field that specifies the number of 32-bit words needed to contain all of the unwind codes in section 3. If more than 31 words are required (that is, if there are more than 124 unwind code bytes), then this field must be 0 to indicate that an extension word is required.
221
+
f. **Code Words** is a 5-bit field that specifies the number of 32-bit words needed to contain all of the unwind codes in section 3. If more than 31 words (that is, 124 unwind codes) are required, then this field must be 0 to indicate that an extension word is required.
222
222
223
223
g. **Extended Epilog Count** and **Extended Code Words** are 16-bit and 8-bit fields, respectively. They provide more space for encoding an unusually large number of epilogs, or an unusually large number of unwind code words. The extension word that contains these fields is only present if both the **Epilog Count** and **Code Words** fields in the first header word are 0.
224
224
225
-
1. If **Epilog Count** isn't zero, a list of information about epilog scopes, packed one to a word, comes after the header and optional extended header. They're stored in order of increasing starting offset. Each scope contains the following bits:
225
+
1. If the count of epilogs isn't zero, a list of information about epilog scopes, packed one to a word, comes after the header and optional extended header. They're stored in order of increasing starting offset. Each scope contains the following bits:
226
226
227
227
a. **Epilog Start Offset** is an 18-bit field that has the offset in bytes, divided by 4, of the epilog relative to the start of the function.
228
228
@@ -281,15 +281,15 @@ If exceptions were guaranteed to only ever occur within a function body, and nev
281
281
282
282
- By counting the number of instructions before the end of the prolog, it's possible to skip the equivalent number of unwind codes. We can execute the rest of the sequence to undo only those parts of the prolog that have completed execution.
283
283
284
-
The unwind codes are encoded according to the table below. All unwind codes are a single/double byte, except the one that allocates a huge stack. There are 22 unwind codes in total. Each unwind code maps exactly one instruction in the prolog/epilog, to allow for unwinding of partially executed prologs and epilogs.
284
+
The unwind codes are encoded according to the table below. All unwind codes are a single/double byte, except the one that allocates a huge stack (`alloc_l`). There are 22 unwind codes in total. Each unwind code maps exactly one instruction in the prolog/epilog, to allow for unwinding of partially executed prologs and epilogs.
285
285
286
286
| Unwind code | Bits and interpretation |
287
287
|--|--|
288
288
|`alloc_s`| 000xxxxx: allocate small stack with size \< 512 (2^5 * 16). |
289
289
|`save_r19r20_x`| 001zzzzz: save `<x19,x20>` pair at `[sp-#Z*8]!`, pre-indexed offset >= -248 |
290
290
|`save_fplr`| 01zzzzzz: save `<x29,lr>` pair at `[sp+#Z*8]`, offset \<= 504. |
291
291
|`save_fplr_x`| 10zzzzzz: save `<x29,lr>` pair at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
292
-
|`alloc_m`| 11000xxx'xxxxxxxx: allocate large stack with size \<16k (2^11 * 16). |
292
+
|`alloc_m`| 11000xxx'xxxxxxxx: allocate large stack with size \<32K (2^11 * 16). |
293
293
|`save_regp`| 110010xx'xxzzzzzz: save `x(19+#X)` pair at `[sp+#Z*8]`, offset \<= 504 |
294
294
|`save_regp_x`| 110011xx'xxzzzzzz: save pair `x(19+#X)` at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
295
295
|`save_reg`| 110100xx'xxzzzzzz: save reg `x(19+#X)` at `[sp+#Z*8]`, offset \<= 504 |
Copy file name to clipboardExpand all lines: docs/build/clang-support-cmake.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,14 @@ You can use Visual Studio with Clang to edit and debug C++ CMake projects that t
24
24
::: moniker-end
25
25
::: moniker range="msvc-160"
26
26
27
-
For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. When using a custom Clang installation, check the **C++ Clang-cl for v142 build tools** component.
27
+
For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose the **C++ Clang-cl for v142 build tools** or **C++ Clang-cl for v143 build tools** component.
28
28
29
29

30
30
31
31
::: moniker-end
32
32
::: moniker range="msvc-170"
33
33
34
-
For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. When using a custom Clang installation, check the **MSBuild support for LLVM (clang-cl) toolset** component.
34
+
For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose the **MSBuild support for LLVM (clang-cl) toolset** component.
35
35
36
36

Because *constant-expression* is optional, the syntax has two forms:
31
+
Because *`constant-expression`* is optional, the syntax has two forms:
32
32
33
-
- The first form defines an array variable. The *constant-expression* argument within the brackets specifies the number of elements in the array. The *constant-expression*, if present, must have integral type, and a value larger than zero. Each element has the type given by *type-specifier*, which can be any type except **`void`**. An array element cannot be a function type.
33
+
- The first form defines an array variable. The *`constant-expression`* argument within the brackets specifies the number of elements in the array. The *`constant-expression`*, if present, must have integral type, and a value larger than zero. Each element has the type given by *`type-specifier`*, which can be any type except **`void`**. An array element can't be a function type.
34
34
35
-
- The second form declares a variable that has been defined elsewhere. It omits the *constant-expression* argument in brackets, but not the brackets. You can use this form only if you previously have initialized the array, declared it as a parameter, or declared it as a reference to an array explicitly defined elsewhere in the program.
35
+
- The second form declares a variable that has been defined elsewhere. It omits the *`constant-expression`* argument in brackets, but not the brackets. You can use this form only if you've previously initialized the array, declared it as a parameter, or declared it as a reference to an array that's explicitly defined elsewhere in the program.
36
36
37
-
In both forms, *direct-declarator* names the variable and can modify the variable's type. The brackets (**[]**) following *direct-declarator* modify the declarator to an array type.
37
+
In both forms, *`direct-declarator`* names the variable and can modify the variable's type. The brackets (**`[ ]`**) following *`direct-declarator`* modify the declarator to an array type.
38
38
39
39
Type qualifiers can appear in the declaration of an object of array type, but the qualifiers apply to the elements rather than the array itself.
40
40
41
41
You can declare an array of arrays (a "multidimensional" array) by following the array declarator with a list of bracketed constant expressions in this form:
Each *constant-expression* in brackets defines the number of elements in a given dimension: two-dimensional arrays have two bracketed expressions, three-dimensional arrays have three, and so on. You can omit the first constant expression if you have initialized the array, declared it as a parameter, or declared it as a reference to an array explicitly defined elsewhere in the program.
45
+
Each *`constant-expression`* in brackets defines the number of elements in a given dimension: two-dimensional arrays have two bracketed expressions, three-dimensional arrays have three, and so on. You can omit the first constant expression if you've initialized the array, declared it as a parameter, or declared it as a reference to an array explicitly defined elsewhere in the program.
46
46
47
47
You can define arrays of pointers to various types of objects by using complex declarators, as described in [Interpreting More Complex Declarators](../c-language/interpreting-more-complex-declarators.md).
48
48
@@ -52,7 +52,7 @@ Arrays are stored by row. For example, the following array consists of two rows
52
52
char A[2][3];
53
53
```
54
54
55
-
The three columns of the first row are stored first, followed by the three columns of the second row. This means that the last subscript varies most quickly.
55
+
The three columns of the first row are stored first, followed by the three columns of the second row. It means that the last subscript varies most quickly.
56
56
57
57
To refer to an individual element of an array, use a subscript expression, as described in [Postfix Operators](../c-language/postfix-operators.md).
58
58
@@ -72,7 +72,7 @@ struct {
72
72
} complex[100];
73
73
```
74
74
75
-
This is a declaration of an array of structures. This array has 100 elements; each element is a structure containing two members.
75
+
This example is a declaration of an array of structures. This array has 100 elements; each element is a structure containing two members.
76
76
77
77
```C
78
78
externchar *name[];
@@ -82,7 +82,7 @@ This statement declares the type and name of an array of pointers to **`char`**.
82
82
83
83
**Microsoft Specific**
84
84
85
-
The type of integer required to hold the maximum size of an array is the size of **size_t**. Defined in the header file STDDEF.H, **size_t** is an **`unsigned int`** with the range 0x00000000 to 0x7CFFFFFF.
85
+
The type of integer required to hold the maximum size of an array is the size of **`size_t`**.
0 commit comments