> 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).
