Understanding WebAssembly in .Net Parlance

PS: In .Net equivalence, WebAssembly is like CIL (Common Intermediate Language)

CIL bytecode has instructions for the following groups of tasks:

Computational model

The Common Intermediate Language is object-oriented and stack-based. That means that data is pushed on a stack instead of pulled from registers as in most CPU architectures.

In x86 it might look like this:

add eax, edx

The corresponding code in IL can be rendered as this:

stloc.0    // a = a + b or a += b;

Here are two locals that are pushed on the stack. When the add-instruction is called the operands get popped and the result is pushed. The remaining value is then popped and stored in the first local.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s