What do the OpCodes IL prefix do?

I played with IL, and I noticed OpCodes, like Prefix1 , with documentation basically telling me not to worry about it, Naturally, it makes me pretty curious about what these various OpCodes prefixes actually do. A quick google search didn’t show anything, so I thought I would ask the experts here. Does anyone know what that means?

+3
source share
2 answers

While most opcodes are single bytes, there are several opcodes that contain 2 bytes in current use. For example, Opcodes.LdLoc is encoded as 0xfe + 0x0c. You can probably guess the value of Opcodes.Prefix1, it ix 0xfe. Prefix 2-7 for future extensibility. They are marked as "do not use" because multibyte opcodes already have a prefix included in their value (fields m_s1 and m_s2).

If you are interested in background information, you need to look at the standard Ecma-335 document .

+5
source

Source: https://habr.com/ru/post/1746444/


All Articles