# PutMem1
{: .no_toc }

Writes one byte to a memory address.

Syntax: **PutMem1** *Address* **,** *Value*

*Address*
: *required* **LongPtr**. The address to write to.

*Value*
: *required* **Byte**. The byte to store at *Address*.

The address is written directly with no bounds or alignment check. Writing to an address that does not belong to the process, or one that points into read-only memory, will crash the host.

### Common Errors

| Error | When |
|---|---|
| [94 (`&H5E`)](/Reference/Run-time-Errors.md#94), *Invalid use of Null* | *Address* or *Value* is **Null** |

### Example

This example writes a single byte to a buffer and reads it back.

```tb check_build
Dim buf As LongPtr = AllocMem(4)
PutMem1 buf, &HFF
Dim b As Byte
GetMem1 buf, b          ' b = &HFF
FreeMem buf
```

### See Also

- [PutMem2](/tB/Modules/HiddenModule/PutMem2.md), [PutMem4](/tB/Modules/HiddenModule/PutMem4.md), [PutMem8](/tB/Modules/HiddenModule/PutMem8.md), [PutMemPtr](/tB/Modules/HiddenModule/PutMemPtr.md) procedures
- [GetMem1](/tB/Modules/HiddenModule/GetMem1.md) procedure
