简体   繁体   中英

What are those symbols in IL code?

What is this symbol ( IL_0000 etc) in the IL code. its this the real memory heap address?

  IL_0000:  nop
  IL_0001:  ldstr      "here is something"
  IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
  IL_000b:  nop
  IL_000c:  ldc.i4.s   18
  IL_000e:  newobj     instance void Proj.Stock::.ctor(int32)
  IL_0013:  stloc.0
  IL_0014:  ldstr      "another"
  IL_0019:  call       void [mscorlib]System.Console::WriteLine(string)
  IL_001e:  nop
  IL_001f:  ldstr      "and even more"
  IL_0024:  call       void [mscorlib]System.Console::WriteLine(string)
  IL_0029:  nop
  IL_002a:  ret

The IL_0000: is a Code Label. It's really just an identifier so you can easily reference jump locations by name instead of by byte count.

See the Common Language Infrastructure (CLI) standard documents. ECMA-335 section II.5.4

II.5.4 Labels and l ists of labels

Labels are provided as a programming convenience; they represent a number that is encoded in the metadata. The value represented by a label is typically an offset in bytes from the beginning of the current method, although the precise encoding differs depending on where in the logical metadata structure or CIL stream the label occurs.

...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM