Skip to content
paul59 edited this page May 22, 2020 · 10 revisions

memset

memset addr val len

Parameters:

  • addr : the address of the first byte of 64k RAM you want to write to
  • val : the value you want to write
  • len : the length of the memory block you want to set

Description:

This function allows you to set a continuous block of any part of TIC's RAM to the same value. The address is specified in hexadecimal format, the value in decimal.

Example memset

-- title: memset demo
-- desc: demonstrate the use of memset
-- script: Lua

function TIC()
  
  -- the screen occupies the first 16320 bytes of TIC's RAM
  -- (240x136 pixels, 4 bits per pixel)
  -- clear the screen by writing zeroes to this block of memory
  memset(0x0000, 0, 16320)

end
Clone this wiki locally