1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
/*
* nanowasm, a tiny WebAssembly/Wasm interpreter
* Copyright (C) 2023-2024 Xavier Del Campo Romero
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifndef OPCODES_H
#define OPCODES_H
enum opcode
{
OP_UNREACHABLE,
OP_NOP,
OP_BLOCK,
OP_LOOP,
OP_IF,
OP_ELSE,
OP_END = 0xb,
OP_BR,
OP_BR_IF,
OP_BR_TABLE,
OP_RETURN = 0xf,
OP_CALL,
OP_CALL_INDIRECT,
OP_DROP = 0x1a,
OP_SELECT,
OP_GET_LOCAL = 0x20,
OP_SET_LOCAL,
OP_TEE_LOCAL,
OP_GET_GLOBAL,
OP_SET_GLOBAL,
OP_I32_LOAD = 0x28,
OP_I64_LOAD,
OP_F32_LOAD,
OP_F64_LOAD,
OP_I32_LOAD8_S,
OP_I32_LOAD8_U,
OP_I32_LOAD16_S,
OP_I32_LOAD16_U,
OP_I64_LOAD8_S,
OP_I64_LOAD8_U,
OP_I64_LOAD16_S,
OP_I64_LOAD16_U,
OP_I64_LOAD32_S,
OP_I64_LOAD32_U,
OP_I32_STORE,
OP_I64_STORE,
OP_F32_STORE,
OP_F64_STORE,
OP_I32_STORE8,
OP_I32_STORE16,
OP_I64_STORE8,
OP_I64_STORE16,
OP_I64_STORE32,
OP_CURRENT_MEMORY,
OP_GROW_MEMORY,
OP_I32_CONST,
OP_I64_CONST,
OP_F32_CONST,
OP_F64_CONST,
OP_I32_SUB = 0x6b
};
#endif
|