Name:
table
Syntax:

TABLE {location},(data,data...)

Location - is an optional constant which specifies where to begin storing the data in the program memory table. If no location is specified, storage continues from where it last left off. If no location was initially specified, storage begins at 0.

Data - are byte constants (0-255) which will be stored in the table.

Description:

Specify values to be loaded to the internal lookup table when the program is downloaded.

M2 parts have 512 locations (0-511). Other parts have 256 (0-255).

This is not an instruction, but a method of pre-loading the microcontroller's program memory lookup table. The data can then be read via the readtable command (the data is fixed, cannot be altered apart from at program download). The tablecopy command may be used to copy the table data to RAM in sections.

18M2 Firmware

Please note the 'table' command is only supported for 18M2 firmware D.x (PICAXE chips labelled 18M2+) and is not available for use with 18M2 firmware 2.x (PICAXE chips labelled 18M2).

The PICAXE compiler will syntax check code for an 18M2 as correct when using the 'table' command but will generate an error when an attempt is made to download into an 18M2 with firmware 2.x.

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

    Define table data

    Define table data values then read the table and show those table data values read

    Code Example:
    	table 0,("Hello World")	; save values in table
    
    main:	for b0 = 0 to 10	; start a loop
    	  readtable b0,b1	; read value from table
    	  serout B.7,N2400,(b1)	; transmit to serial LCD module
    	next b0			; next character
    Copy Code Submit an Example

    Submit Your Own Code!

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

    Comments

    • Login to leave a comment.