Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/reference/memory/load/index.md
6510 views
---
title: Load slug: WebAssembly/Reference/Memory/Load
---

{{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

;; the offset from where to load the number i32.const 0 ;; load the number at position 0 i32.load
InstructionBinary opcode
i32.load0x28
i64.load0x29
f32.load0x2a
f64.load0x2b
i32.load8_s0x2c
i32.load8_u0x2d
i32.load16_s0x2e
i32.load16_u0x2f
i64.load8_s0x30
i64.load8_u0x31
i64.load16_s0x32
i64.load16_u0x33
i64.load32_s0x34
i64.load32_u0x35