> For the complete documentation index, see [llms.txt](https://xiayingp.gitbook.io/build_a_os/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xiayingp.gitbook.io/build_a_os/hardware-device-assembly/assembly-access-and-store-information-in-memory.md).

# Assembly: Access and Store information in Memory

### Sizes of C data types in X86-64

![](/files/-M4bwUm3qH5YYvwr6uk3)

### Operand forms in X86-64

![](/files/-M4bwhYhPb_JCJXb59O9)

`M[Addr]` means a reference to the value stored in memory starting at address `Addr`.

The memory of address `Addr` could come from user space, CPU and MLU works together to get the physical page (PA) from Page Table, then access the PA in RAM.

### RISC-V Integer Instructions

![](/files/-M4bwlJ_s74xG_zSNA_w)

The operand forms is basically the same. `lb D, S` `sb S, D`

Example: `sd ra,40(sp)` Save 8 bytes (double) from `ra` register to memory address of (sp + 40).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xiayingp.gitbook.io/build_a_os/hardware-device-assembly/assembly-access-and-store-information-in-memory.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
