This routine writes an int value into the scratch pad. An int takes up two bytes in the scratch pad. The bytes are stored in high-byte low-byte order. The index x is the address of the high byte.
The scratch pad is accessible by all processes and reflexes. It provides a convenient means for parameter passing between processes and reflexes and is more efficient than using semaphores. It is the user's responsibility to keep track of scratch pad locations and prevent overwriting of data.
The GP 1.0 and 2.0 modules have 56 bytes of scratch pad RAM. This allows storage of up to 28 int values. Because an int is 2 bytes, valid indexes for storing and retrieving an int are 0-54. The index does not have to be an even number. (Some firmware versions may require an even index. )
This would write a value of 1234 into scratch pad bytes 0 and 1.