i32.eqz
Pops an i32 value off the stack, checks to see if it is zero, and then pushes the result back on to the stack.
if ($value === 0) {...}

Syntax

i32.eqz

Stack In

i32 The value to be checked.

Stack Out

i32 The result of the check. If the value is 0 then the result will be 1. If the value is anything else then the result will be 0.

Examples

;; Push the i32 value 101 onto the stack
i32.const 101

;; Pop the i32 value off the stack, check if it is zero and
;; push the result back onto the stack
i32.eqz

;; The stack contains an i32 value of 0 (not zero)
;; Push the i32 value 0 onto the stack
i32.const 0

;; Pop the i32 value off the stack, check if it is zero and
;; push the result back onto the stack
i32.eqz

;; The stack contains an i32 value of 1 (is zero)