local.set
Write a local or parameter.
core0x21
Syntax
local.set
Stack Effect
[local type] -> []Opcode
- Hex
0x21- Decimal
33- Bytes
[0x21]- Encoding
0x21 <localidx:u32-leb128>- Immediates
localidx:u32-leb128
- Category
- variable
Browser Support
Core WebAssembly instruction.
Validation Rules
- Operands and result types must match the instruction signature.
- The instruction must appear in a valid structured control context.
Common Mistakes
- Using the instruction with the wrong operand type.
- Forgetting that WAT validation is stack-typed.
(func $example
;; local.set example
)