Name:
lookup
Syntax:

LOOKUP offset,(data0,data1...dataN),variable

Offset - is a variable/constant which specifies which data# (0-N) to place in Variable.

Description:

Lookup data specified by offset and store in variable (if in range).

The lookup command is used to load variable with different values. The value to be loaded in the position in the lookup table defined by offset. If offset exceeds the number of entries in the lookup table the value of variable is unchanged.

Each lookup is limited to 256 entries, but each entry may be a bit, byte or word constant or variable.

Applies To:
All
See Also:
Related Create:
    Share:
    Print:

    Lookup ascii data

    In this example if b0 = 0 then b1 will equal "a", if b0 =1 then b1 will equal "b" etc.

    Code Example:
    main:	lookup b0,("abcde"),b1	; put ASCII character into b1
    	inc b0			; increment b0
    	if b0 < 4 then main	; loop
    	end
    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.