Name:
put
Syntax:

PUT location,data,data,WORD wordvariable...

Location - is a variable/constant specifying a scratchpad address. Valid values are

0 to 127 for X1 parts
0 to 127 for 20X2 parts
0 to 1023 for all other X2 parts

Data - is a variable/constant which provides the data byte to be written. To use a word variable the keyword WORD must be used before the wordvariable.

Description:

Write data into scratchpad location.

The function of the put/get commands is store temporary byte data in the microcontroller's scratchpad memory. This allows the general purpose variables (b0, b1, etc.) to be re-used in calculations. Put and get have no effect on the scratchpad pointer and so the address next used by the indirect pointer (ptr) will not change during these commands.

When word variables are used (with the keyword WORD) the two bytes of the word are saved/retrieved in a little endian manner (ie low byte at address, high byte at address + 1)

Applies To:
20X2, 28X1, 28X2, 40X1, 40X2
See Also:
Related Create:
    Share:
    Print:

    Write data to the scratchpad

    Write the value of b1 to scratchpad location 1, then write the data in w1 to locations 1 and 2

    Code Example:
    	put 1,b1	; save value of b1 in register 1
    	put 1, word w1
    Copy Code Submit an Example

    Submit Your Own Code!

    You must be logged in to submit code examples. Login now.