memset( destaddr, val, len )

Writes a byte value to every address in a region of memory.

The address of the first memory location to write.
The byte value to write.
The length of the region of memory to write, as a number of bytes.

The memset() function is a fast way to fill a region of memory with one byte value.

Examples Edit

-- clear all user data
memset(0x4300, 0, 0x1b00)
-- fill the screen with white
-- (equivalent to rectfill(0,0,128,128,7))
memset(0x6000, 0x77, 0x2000)

See also Edit