m (put the ref to memory on its own line to draw attention to it) Tag: Source edit |
(revert to actually specifying a first argument, just for the sake of clarity with new users, but keep the varargs documentation too; some link formatting) Tag: Source edit |
||
Line 3: | Line 3: | ||
|shortdesc=Writes one or more bytes to contiguous memory locations. |
|shortdesc=Writes one or more bytes to contiguous memory locations. |
||
|addr||The address of the first memory location. |
|addr||The address of the first memory location. |
||
− | | |
+ | |value|optional|The byte value to write to memory. Defaults to 0. |
+ | |...|optional|Additional byte values to be written consecutively to memory. |
||
}} |
}} |
||
− | The <code>poke()</code> function writes one or more bytes to the addressable memory region |
+ | The <code>poke()</code> function writes one or more bytes to the 16-bit-addressable memory region. |
See [[Memory]] for information about the memory layout. |
See [[Memory]] for information about the memory layout. |
||
Line 20: | Line 21: | ||
* [[Memory]] |
* [[Memory]] |
||
− | * [[Peek| |
+ | * <code>[[Peek|peek()]]</code> |
− | * [[Peek2| |
+ | * <code>[[Peek2|peek2()]]</code> |
− | * [[Peek4| |
+ | * <code>[[Peek4|peek4()]]</code> |
− | * [[Poke2| |
+ | * <code>[[Poke2|poke2()]]</code> |
− | * [[Poke4| |
+ | * <code>[[Poke4|poke4()]]</code> |
− | * [[Memcpy| |
+ | * <code>[[Memcpy|memcpy()]]</code> |
− | * [[Reload| |
+ | * <code>[[Reload|reload()]]</code> |
− | * [[Cstore| |
+ | * <code>[[Cstore|cstore()]]</code> |
− | * [[Memset| |
+ | * <code>[[Memset|memset()]]</code> |
[[Category:Reference]] |
[[Category:Reference]] |
||
[[Category:API]] |
[[Category:API]] |
Latest revision as of 22:35, 29 June 2021
poke( addr, [value,] [...] )
- Writes one or more bytes to contiguous memory locations.
- addr
-
- The address of the first memory location.
- value
-
- The byte value to write to memory. Defaults to 0.
- ...
-
- Additional byte values to be written consecutively to memory.
The poke()
function writes one or more bytes to the 16-bit-addressable memory region.
See Memory for information about the memory layout.
See poke2()
for a way to write 16-bit values to groups of two consecutive memory addresses, and poke4()
to write 32-bit values to groups of four consecutive memory addresses.
Examples[]
poke(0x4300, 255) -- write a byte to user RAM
poke(0x5f5c, delay, interval) -- set up btnp() intervals