Skip to content

Commit 9d1bdae

Browse files
committed
Add explanation of memory
1 parent 84c5416 commit 9d1bdae

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,26 @@ for (int i = 0; i < 10; i++) {
216216
| <= | `le_s` | `le_s` | `le` | `le` |
217217
| > | `gt_s` | `gt_s` | `gt` | `gt` |
218218
| >= | `ge_s` | `ge_s` | `ge` | `ge` |
219+
220+
### Linear Memory
221+
222+
`memory` is a sandboxed array of bytes
223+
224+
```WebAssembly
225+
(memory $memory 1)
226+
```
227+
228+
`load` and `store` are used for reading and writing from `memory`
229+
230+
```WebAssembly
231+
(func $load (param $a i32) (result i32)
232+
(i32.load
233+
(get_local $a)))
234+
```
235+
236+
```WebAssembly
237+
(func $store (param $a i32) (param $b i32)
238+
(i32.store
239+
(get_local $a)
240+
(get_local $b)))
241+
```

0 commit comments

Comments
 (0)