# PutMem8
{: .no_toc }

Writes eight bytes to a memory address.

Syntax: **PutMem8** *Address* **,** *Value*

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

*Value*
: *required* **Currency**. A **Currency** carrier whose underlying eight bytes are stored at *Address*.

**Currency** is used as the eight-byte carrier --- its in-memory representation is a raw 64-bit pattern, scaled by the type's fixed factor of 10000 only at the point of arithmetic. To pack an arbitrary 64-bit integer, [**LSet**](/tB/Core/LSet.md) it into a **Currency** before calling **PutMem8**.

The address is written directly with no bounds or alignment check.

### 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 an 8-byte value to a buffer and reads it back.

```tb check_build
Dim buf As LongPtr = AllocMem(8)
Dim src As Currency = 1000000@
PutMem8 buf, src
Dim dst As Currency
GetMem8 buf, dst        ' dst = src (same raw 8-byte pattern)
FreeMem buf
```

### See Also

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