Takes two operands (both of the same numeric type), adds them, and places the result on the stack 1 2 3.
Opcode | Instruction | Stack Arity |
---|---|---|
0x6A |
i32.add |
|
0x7C |
i64.add |
|
0x92 |
f32.add |
|
0xA0 |
f64.add |
;; Places 2 values on the stack
i32.const 10
i32.const 20
;; Takes two values off of the stack (10 and 20), adds them, and
;; places the result (30) on the stack
i32.add
Footnotes
-
Structure, Numeric Instructions - https://www.w3.org/TR/wasm-core-2/syntax/instructions.html#numeric-instructions ↩
-
Execution, Numerics, Integer Operations, iadd - https://www.w3.org/TR/wasm-core-2/exec/numerics.html#op-iadd ↩
-
Execution, Numerics, Floating-Point Operations, fadd - https://www.w3.org/TR/wasm-core-2/exec/numerics.html#op-fadd ↩