Specifications

then the previously specified handler function will be invoked with the number of the IO pin that
changed state, and the pin’s new value.
This function does not return a value.
See also function setRate(), which controls the sampling rate of the background pin monitoring that is
enabled/disabled by this function.
ord(str) – Return the integer ASCII ordinal value of a character
Parameter str specifies a single-character string to be converted. For example, ord('A') = 65 (0x41),
and ord('2') = 50 (0x32).
peek(address) or peek(addressHi, addressLow, word) – Read a memory
location
The peek() function allows you to read a byte from a memory location. On 16-bit platforms, parameter
address specifies which memory location to read (0-0xFFFF). On 32-bit platforms, the two address
parameters are required to specify the target address.
On 16-bit platforms, this function returns an integer in the range 0-255. On 32-bit platforms, the size
and character of the return value is determined by the word parameter:
0 = Return one byte (0x00 to 0xFF).
1 = Return one 16-bit integer (0x0000 to 0xFFFF).
2 = Return the high 16-bit integer of a 32-bit value, storing the low value for later retrieval.
3 = Return the low 16-bit integer of a 32-bit value, discarding the high value.
4 = Return the low 16-bit integer of a 32-bit value that has previously been stored using word = 2.
You can use peek() with no parameters as a substitute for this. Performing this peek before
storing a value using word = 2 provides an undefined result.
On 32-bit systems, you must have a properly aligned address when reading memory larger than one
byte, i.e., when peeking a 16-bit value, your address must be even, and when peeking a 32-bit value,
your address must be divisible by 4.
On platforms using the 8051 processor, special function registers (SFRs) are available in SNAPpy by
specifying the peek address as -1 * ((SFR_page * 0x100) + SFR_address). For example, if you wanted
to peek register 0x92 on page 0x0F, you would use:
Peek(-0x0F92)
If the register you wish to peek is in page 0, the leading byte can be omitted. To peek SFR register
0xF5 in SFR bank 0, you would use:
Peek (-0xF5)
or
Peek(-0x00F5)
This function is intended for advanced users only.
SNAP Reference Manual Document Number 600-0007K Page 63 of 202