WAT can declare, import, or export memory. Load/store instructions use stack-provided addresses plus static offset/alignment immediates.

wasm
(memory $memory 1 4)
(export "memory" (memory $memory))
(data (i32.const 0) "hello")
(func $read (param $p i32) (result i32)
  local.get $p
  i32.load8_u)
  • `memory.size` returns page count.
  • `memory.grow` attempts growth and returns the old size or -1.
  • Bulk memory includes `memory.copy`, `memory.fill`, `memory.init`, and `data.drop`.
  • memory64 and multiple memories are runtime-dependent features.