| poke | Function (Macro)

peekpoke.h

#define poke(addr,val) (void)(*((unsigned char*)(long)(addr)) = (val))

Stores a byte in memory.

poke is a macro which stores a byte val at the memory address addr, where addr does not necessarily need to be a pointer. Instead, it can be of any type (usually an integer) which may represent a memory address in a way which makes sense. This way it allows for storing bytes in memory using the style which is common in most dialects of the BASIC language. For example, to store a byte 255 at the first byte of the video memory, do this:

    poke (0x4C00, 255);

Note: Do not use poke for sending bytes to I/O ports! Use pokeIO instead.