Inside Microsoft .NET IL Assembler Comments And Corrections (319941)



The information in this article 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 <classAttr> Incorrect
  • Page 402: BNF For <paramAttr> Incorrect
  • Page 405: BNF For <propHead> Incorrect
  • Page 405: BNF For <customAttrDecl> Incorrect

MORE INFORMATION

Page 12: Missing Text

On page 12, the first sentence after the sidebar is incorrect.

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

To:
"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."

Page 42: Figure 3-2 Incorrect

On page 42, Figure 3-2 is incorrect.

Change the top rectangle from:
"MS-DOS stub (64 bytes)"

To:
"MS-DOS stub (128 bytes)"

Page 55: Table 3-5 Incorrect

On page 55, Table 3-5 is incorrect.

Change:
"Reset speculative exception handling bits in the type library (TLB) entries for this section."

To:
"Reset speculative exception handling bits in the translation lookaside buffer (TLB) entries for this section."

Page 80: Second Table Text Incorrect

On page 80, the second table is incorrect.

Change the last row from:
"char[16]rcName Name of the stream; a zero-terminated ANSI string no longer than seven characters"

To:
"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."

Page 108: Text From Step 3 Incorrect

On page 108, the text from step 3 on is incorrect.

Change:
"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 {<rootk>, k=1.N}. If the AssemblyRef specifies the culture, the search is performed in directories <rootk>/<culture> and then in <rootk>/<culture>/<name>; otherwise, the directories <rootk> and then <rootk>/<name> 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."


To:
"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 '{<root_k>, k=1,...,N}'. If the 'AssemblyRef' specifies the culture, the search is performed in directories '<root_k>/<culture>' and then in '<root_k>/<culture>/<name>'; otherwise, the directories '<root_k>' and then '<root_k>/<name>' 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."

(Note that <root_k> should be "root" with a subscript "k")

Page 138: Incorrect Capitalization

On page 138, in the second bullet point from the bottom,

Change:
"Interface"

To: "interface"

Page 175: 3rd Bulleted Item Is Incorrect

On page 175, in 3rd bullet point from top,

Change:
"'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'.""

To:
"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'."

Page 192: Missing Text

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

"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."

Page 207: Incorrect Description For Flag

On page 207, the description for Method Implementation flag 'runtime (0x0003)' is incorrect.

Change:
"The method implementation is provided by the runtime itself. If this flag is set, the RVA of the method must be 0."

To:
"The method implementation is generated by the runtime itself. If this flag is set, the RVA of the method must be 0."

Page 222: Incorrect First Paragraph

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

Change:
"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."

To:
"Initialization means that all variables of value types are zeroed, and all variables of object reference types are set to null."

Page 245: Incorrect Description For Last Bulleted Item

On page 245, last bullet point ('ldc.r8'), the description is incorrect.

Change:
"Load '<float64>' (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;"

To:
"Load '<float64>' (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."

Page 263: Typographical Error

On page 263,

Change:
"An array conmstructor takes..."

To:
"An array constructor takes..."

Page 264: Incorrect Text In 2nd-to-last Bullet

On page 264, the 2nd bullet from the bottom is incorrect.

Change:
"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."

To:
"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 "from outside", and, without the token parameter, the verifier can't identify the type of the result."

Page 351: Incorrect Text In 2nd-to-last Bullet

On page 351, the 2nd bullet from the bottom is incorrect.

Change: "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."

To:
"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."

Page 395: BNF For <classAttr> Incorrect

On page 395, /*EMPTY*/ should be added to the BNF for <classAttr>.

Change:
'<classAttr>' ::= '<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: " | '<paramAttr>' [ '<int32>' ]"".

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

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

Page 405: BNF For <propHead> Incorrect

On page 405, BNF for <propHead> is incorrect.

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

To:
'<propHead>' ::= .property '<propAttr>' '<callConv>' '<type>'
                             '<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> = ( <bytes> ) 
                 | .custom <customType> = <compQstring> 
                 | .custom (<ownerType>) <customType> 
                 | .custom (<ownerType>) <customType> =
                                         <compQstring> 
                 | .custom (<ownerType>) <customType> = ( <bytes> )

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

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.

Modification Type:MinorLast Reviewed:4/23/2003
Keywords:kbdocerr kbdocfix kbinfo KB319941