[MSIL] calls

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

[MSIL] calls

Post by King Harold »

How are MSIL calls translated to bytecodes? Ok the first byte is 0x28, but you can't just call blindly so it has to have something behind it to specify where to jump..


I know it's a stupid question but google isn't being cooperative so I haven't found anything about it

edit: with over 300 members, there's gotta be someone who knows..
coelurus
Calc Wizard
Posts: 585
Joined: Sun 19 Dec, 2004 9:02 pm
Location: Sweden
Contact:

Post by coelurus »

Don't put demands on forum members.

Did a 3-seconds search on google and the first hit turned up the following on MS's own site:
...whose opcode is 0x28. This is the call instruction, which takes a 4-byte token as a parameter. In order to read the next IL instruction, I'll skip the next 5 bytes (one for the call opcode, 0x28, and 4 bytes for the token...
You'll have to figure out yourself how the address token works :)
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

coelurus wrote:You'll have to figure out yourself how the address token works :)
That is exactly my problem.. any ideas?
Goplat
New Member
Posts: 12
Joined: Mon 16 Jul, 2007 2:46 pm

Post by Goplat »

The high byte specifies which metadata table the token refers to, and the low 3 bytes give the index of the table row.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

ECMA-335 should contain the information you need. I have not written a virtual machine or compiler for the CLI, so can't help you.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Ok thanx :)
Post Reply