Path: blob/main/files/en-us/webassembly/reference/memory/load/index.md
6510 views
------{{WebAssemblySidebar}}
The load instructions, are used to load a number from memory onto the stack.
For the integer numbers, you can also load a narrower number from memory and extend it into a wider type, e.g. load an unsigned 8-bit number and convert it into an i32 (i32.load8_u). These instructions are separate for signed and unsigned numbers.
{{EmbedInteractiveExample("pages/wat/load.html", "tabbed-taller")}}
Syntax
| Instruction | Binary opcode |
|---|---|
i32.load | 0x28 |
i64.load | 0x29 |
f32.load | 0x2a |
f64.load | 0x2b |
i32.load8_s | 0x2c |
i32.load8_u | 0x2d |
i32.load16_s | 0x2e |
i32.load16_u | 0x2f |
i64.load8_s | 0x30 |
i64.load8_u | 0x31 |
i64.load16_s | 0x32 |
i64.load16_u | 0x33 |
i64.load32_s | 0x34 |
i64.load32_u | 0x35 |