tags:

views:

47

answers:

2

I've been playing around with IL and I noticed OpCodes like Prefix1, with documentation basically telling me not to worry about it. Naturally, this makes me quite curious as to what these various Prefix OpCodes actually do. A quick Google search didn't turn up anything, so I thought I'd ask the experts here. Does anybody know what these mean?

+2  A: 

http://msdn.microsoft.com/en-us/library/812xyxy2(v=VS.95).aspx

As for the Prefix1, it is a reserved instruction that you should not use. Maybe it is reserved for some future version.

Darin Dimitrov
I appreciate the handy link, but that's actually what I linked to in my question. :) I'm just excessively curious and hoping someone might have insight into these mysterious instructions.
Dan Bryant
+2  A: 

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

If you're interested in the background info, you'll want to take a look at the Ecma-335 standard document.

Hans Passant
Cool, thanks. I'll have to check out the standards document.
Dan Bryant