Memory access reads and writes the simulated byte-addressed storage. Multi-byte data uses little-endian order; the raw word writer makes the layout explicit:
Mem_WriteRawByte(addr + 0, (value >> 0) & 0xff); Mem_WriteRawByte(addr + 1, (value >> 8) & 0xff); Mem_WriteRawByte(addr + 2, (value >> 16) & 0xff); Mem_WriteRawByte(addr + 3, (value >> 24) & 0xff);
Writing 0x12345678 stores bytes 78 56 34 12 at increasing addresses. Reads reconstruct the word from the same layout.
Memory is divided into pages allocated on demand when written. Reading an entirely unallocated page returns zero. Allocated pages come from malloc, so this should not be confused with a guarantee that every unwritten byte inside an existing page is initialized.
Raw helpers operate on storage directly. Ordinary word helpers first recognize mapped addresses, where a callback can provide terminal input, print output, or change timer settings. Program loading uses raw writes so copying an image does not accidentally perform device I/O.
Source: emulator.c.