Read U16

Signature

u16 readU16(u64 address)

Description

Reads a 16-bit unsigned integer from a given memory address and returns it.

Arguments

Address

The memory address where the integer will be read from.

Alternative Syntax

The syntax local value = memory.u16[address] can be used as a alternative.

Unsafe Version

An unsafe version is also available that skips safety checks in favor of improved performance. This should only be used when memory validity is guaranteed.

Unsafe functions are marked with a u suffix, such as readU16u, or can be used with the alternative syntax: local value = memory.u16u[address].

Last updated