FANDOM


memset( destaddr, val, len )
Writes a byte value to every address in a region of memory.
destaddr
The address of the first memory location to write.

val
The byte value to write.

len
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

Community content is available under CC-BY-SA unless otherwise noted.