Commit Graph

5 Commits

Author SHA1 Message Date
Ali Mohammad Pur
30736c39b9 LibWasm: Make opcode definitions enumerable through a macro 2021-11-11 09:20:04 +01:00
Ali Mohammad Pur
02b3238c41 LibWasm: Parse the "extend" set of instructions 2021-06-02 16:09:16 +04:30
Ali Mohammad Pur
7a12f23c28 LibWasm: Un-nest the structured instructions 2021-05-13 19:44:32 +01:00
Ali Mohammad Pur
50cb80649f LibWasm: Implement parsing all remaining instructions
With this, we can parse a module at least as simple as the following C
code would generate:
```c
int add(int x, int y) {
    if (x > y)
        return x + y;
    return y - x; // Haha goteeem
}
```
2021-05-08 22:14:39 +02:00
Ali Mohammad Pur
aa4d8d26b9 LibWasm: Start implementing a basic WebAssembly binary format parser
This can currently parse a really simple module.
Note that it cannot parse the DataCount section, and it's still missing
almost all of the instructions.
This commit also adds a 'wasm' test utility that tries to parse a given
webassembly binary file.
It currently does nothing but exit when the parse fails, but it's a
start :^)
2021-05-08 22:14:39 +02:00