Microsoft KB Archive/319941

= Inside Microsoft .NET IL Assembler Comments And Corrections =

Article ID: 319941

Article Last Modified on 4/23/2003

-

APPLIES TO


 * MSPRESS Inside Microsoft .NET IL Assembler ISBN 0-7356-1547-0

-



This article was previously published under Q319941



SUMMARY
This article contains comments, corrections, and information about known errors relating to the Microsoft Press book Inside Microsoft .NET IL Assembler, ISBN 0-7356-1547-0.

The following topics are covered:


 * Page 12: Missing Text
 * Page 42: Figure 3-2 Incorrect
 * Page 55: Table 3-5 Incorrect
 * Page 80: Second Table Text Incorrect
 * Page 108: Text From Step 3 Incorrect
 * Page 138: Incorrect Capitalization
 * Page 175: 3rd Bulleted Item Is Incorrect
 * Page 192: Missing Text
 * Page 207: Incorrect Description For Flag
 * Page 222: Incorrect First Paragraph
 * Page 245: Incorrect Description For Last Bulleted Item
 * Page 263: Typographical Error
 * Page 264: Incorrect Text In 2nd-to-last Bullet
 * Page 351: Incorrect Text In 2nd-to-last Bullet
 * Page 395: BNF For  Incorrect
 * Page 402: BNF For  Incorrect
 * Page 405: BNF For  Incorrect
 * Page 405: BNF For  Incorrect



Page 12: Missing Text
On page 12, the first sentence after the sidebar is incorrect.

Change:

&quot;You have probably noticed that the declaration of TypeDef in the sample contains three default flags: public, auto and ansi.

To:

&quot;You have probably noticed that the declaration of TypeDef in the sample contains three default items: the auto and ansi flags and extends [mscorlib]System.Object.&quot;

Page 42: Figure 3-2 Incorrect
On page 42, Figure 3-2 is incorrect.

Change the top rectangle from:

&quot;MS-DOS stub (64 bytes)&quot;

To:

&quot;MS-DOS stub (128 bytes)&quot;

Page 55: Table 3-5 Incorrect
On page 55, Table 3-5 is incorrect.

Change:

&quot;Reset speculative exception handling bits in the type library (TLB) entries for this section.&quot;

To:

&quot;Reset speculative exception handling bits in the translation lookaside buffer (TLB) entries for this section.&quot;

Page 80: Second Table Text Incorrect
On page 80, the second table is incorrect.

Change the last row from:

&quot;char[16]rcName Name of the stream; a zero-terminated ANSI string no longer than seven characters&quot;

To:

&quot;char[32]' 'rcName' Name of the stream; a zero-terminated ANSI string no longer than thirty one characters. If the name is shorter, the size of the stream header is respectively less, padded to the nearest 4-byte boundary.&quot;

Page 108: Text From Step 3 Incorrect
On page 108, the text from step 3 on is incorrect.

Change:

&quot;3. Check the CodeBase. Now that the common language runtime knows which version of the assembly it is looking for, it begins the process of locating it. If the CodeBase has been supplied (in the same XML configuration file), it points the runtime directly at the executable to load; otherwise, the runtime needs to look in the AppBase and the GAC, as described in step 4. If the executable specified by the CodeBase matches the assembly reference, the process of finding the assembly is complete, and the external assembly can be loaded. In fact, even if the executable specified by the CodeBase does not match the reference, the common language runtime stops searching. In this case, of course, the search is considered a failure, and no assembly load follows.

4. Check the GAC or the AppBase or both. If the CodeBase hasn’t been supplied, the remainder of the process depends on whether the referenced assembly is private or strong-named.

If the reference is to a private assembly, the process probes the AppBase. The probing involves consecutive searching in the directories defined by the AppBase, the private binary path (binpath) from the same XML configuration file, the culture of the referenced assembly, and its name. The AppBase plus directories specified in the binpath form a set of root directories {, k=1…N}. If the AssemblyRef specifies the culture, the search is performed in directories / and then in / / ; otherwise, the directories and then / are searched. When searching for a private assembly, the process ignores the version numbers. If the assembly is not found by probing, the binding fails.&quot;

To:

&quot;3. If the referenced assembly is strong-named, check the GAC. If the referenced assembly is private (not strong-named), or the strong-named assembly is not found in the GAC, proceed to step 4.

4. Check the 'CodeBase'. If the 'CodeBase' has been supplied (in the same XML configuration file), it points the runtime directly at the executable to load. If the executable specified by the 'CodeBase' matches the assembly reference, the process of finding the assembly is complete, and the external assembly can be loaded. In fact, even if the executable specified by the 'CodeBase' does not match the reference, the common language runtime stops searching. In this case, of course, the search is considered a failure, and no assembly load follows.

If the code base is not specified, but the 'AppBase' is, the process probes the 'AppBase'. The probing involves consecutive searching in the directories defined by the 'AppBase', the private binary path (binpath) from the same XML configuration file, the culture of the referenced assembly, and its name. The 'AppBase' plus directories specified in the binpath form a set of root directories '{, k=1,...,N}'. If the 'AssemblyRef' specifies the culture, the search is performed in directories '/ ' and then in '/ / '; otherwise, the directories '' and then '/ ' are searched. When searching for a private assembly, the process ignores the version numbers. If the assembly is not found by probing, the binding fails.&quot;

(Note that  should be &quot;root&quot; with a subscript &quot;k&quot;)

Page 138: Incorrect Capitalization
On page 138, in the second bullet point from the bottom,

Change:

&quot;Interface&quot;

To: &quot;interface&quot;

Page 175: 3rd Bulleted Item Is Incorrect
On page 175, in 3rd bullet point from top,

Change:

&quot;'IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL' (0x3) C++ member method (non-'vararg') calling convention. The callee cleans the stack, and the 'this' pointer is pushed on the stack last. The ILAsm notation is 'unmanaged thiscall'.&quot;&quot;

To:

&quot;IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL' (0x3) C++ member method (non-'vararg') calling convention. The callee cleans the stack, and the 'this' pointer is passed through the 'ECX' register. The ILAsm notation is 'unmanaged thiscall'.&quot;

Page 192: Missing Text
On page 192, after the code &quot;.class public value sealed explicit Mystruct...&quot; and before the paragraph starting with &quot;Explicit layout is a standard way...&quot;, the following text should be added:

&quot;Value types with explicit layout containing object references must have the size aligned on pointer size, otherwise they fail to load. The reason for this limitation becomes obvious once you consider an array of such value types.&quot;

Page 207: Incorrect Description For Flag
On page 207, the description for Method Implementation flag 'runtime (0x0003)' is incorrect.

Change:

&quot;The method implementation is provided by the runtime itself. If this flag is set, the RVA of the method must be 0.&quot;

To:

&quot;The method implementation is generated by the runtime itself. If this flag is set, the RVA of the method must be 0.&quot;

Page 222: Incorrect First Paragraph
On page 222, the 2nd sentence of the 1st paragraph (under Fig.9-4) is incorrect.

Change:

&quot;Initialization means that for all variables of value types the corresponding default constructors are called, and all variables of object reference types are set to null.&quot;

To:

&quot;Initialization means that all variables of value types are zeroed, and all variables of object reference types are set to null.&quot;

Page 245: Incorrect Description For Last Bulleted Item
On page 245, last bullet point ('ldc.r8'), the description is incorrect.

Change:

&quot;Load ' ' (double-precision) on the stack. ILAsm permits the use of integer parameters or even bytearrays in both 'ldc.r4' and 'ldc.r8' instructions; in such cases, the integers are interpreted as binary image of the floating-point numbers;&quot;

To:

&quot;Load ' ' (double-precision) on the stack. ILAsm permits the use of integer parameters or even bytearrays in both 'ldc.r4' and 'ldc.r8' instructions. For example: 'ldc.r4 1078530000' loads 1078530000.0; 'ldc.r4 float32(1078530000)' loads 3.1415901184082--the integer is interpreted as binary image of the floating-point number; and 'ldc.r4 (D0 0F 49 40)' loads 3.1415901184082.&quot;

Page 263: Typographical Error
On page 263,

Change:

&quot;An array conmstructor takes...&quot;

To:

&quot;An array constructor takes...&quot;

Page 264: Incorrect Text In 2nd-to-last Bullet
On page 264, the 2nd bullet from the bottom is incorrect.

Change:

&quot;Pop a typed reference from the stack, retrieve the instance pointer ('&' or 'native int'), and push it on the stack. This instruction has no parameters.&quot;

To:

&quot;Pop a typed reference from the stack, retrieve the instance pointer ('&' or 'native int'), and push it on the stack. This instruction has one parameter -- token of a type, which must match or be an ancestor of the type of the popped typed reference. If this is not the case, an 'InvalidCast' exception is thrown. Without this limitation, any verification of the code containing 'refanyval' instructions would be impossible, because the typed reference can come &quot;from outside&quot;, and, without the token parameter, the verifier can't identify the type of the result.&quot;

Page 351: Incorrect Text In 2nd-to-last Bullet
On page 351, the 2nd bullet from the bottom is incorrect.

Change: &quot;The native method uses the C++ member method (non-'vararg') calling convention. The call stack is cleaned up by the callee, and the instance pointer ('this') is pushed on the stack last.&quot;

To:

&quot;The native method uses the C++ member method (non-'vararg') calling convention. The call stack is cleaned up by the callee, and the instance pointer ('this') is passed through the 'ECX' register.&quot;

Page 395: BNF For  Incorrect
On page 395, /*EMPTY*/ should be added to the BNF for .

Change:

'' ::= '<classAttr>' public | '<classAttr>' private ... To:

'<classAttr>' ::= /* EMPTY */ | '<classAttr>' public | '<classAttr>' private ...

Page 402: BNF For <paramAttr> Incorrect
On page 402, BNF for <paramAttr> -- at the end, add the clause: &quot; | '<paramAttr>' [ ' ' ]&quot;&quot;.

Change:

<paramAttr> ::= /* EMPTY */ | '<paramAttr>' [in] | '<paramAttr>' [out] | '<paramAttr>' [opt] To:

<paramAttr> ::= /* EMPTY */ | '<paramAttr>' [in] | '<paramAttr>' [out] | '<paramAttr>' [opt] | '<paramAttr>' [ ' ' ]

Page 405: BNF For <propHead> Incorrect
On page 405, BNF for <propHead> is incorrect.

Change:

'<propHead>' ::= .property '<propAttr>' ' ' '<id>' ( '<sigArgs>' ) '<initOpt>' To:

'<propHead>' ::= .property '<propAttr>' '<callConv>' ' ' '<id>' ( '<sigArgs>' ) '<initOpt>'

Page 405: BNF For <customAttrDecl> Incorrect
On page 405, BNF for <customAttrDecl> -- remove the 4th production (duplicate of the 2nd one).

Change:

<customAttrDecl> ::= .custom <customType> | .custom <customType> = <compQstring> | .custom <customType> = | .custom <customType> = <compQstring> | .custom (<ownerType>) <customType> | .custom (<ownerType>) <customType> = <compQstring> | .custom (<ownerType>) <customType> = To:

<customAttrDecl> ::= .custom <customType> | .custom <customType> = <compQstring> | .custom <customType> = | .custom (<ownerType>) <customType> | .custom (<ownerType>) <customType> = <compQstring> | .custom (<ownerType>) <customType> =

Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.

Additional query words: DEVBOOK 0-7356-1547-0 Lidin

Keywords: kbinfo kbdocfix kbdocerr KB319941

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.