Like Ace said, LOOKUP2 will do the job, but it's a bit code heavy.
This is a variant of the Strings idea that allows Very Large 14-bit WORD sized tables in code space.Code:Address VAR WORD DataWord VAR WORD Offset VAR WORD '----------------------------------------------------------------------------- ASM GetAddress macro Label, Wout ; Returns the Address of a Label as a Word CHK?RP Wout movlw low Label movwf Wout movlw High Label movwf Wout + 1 endm ENDASM '-----[The DATA table]-------------------------------------------------------- ASM DataTable DW 1234h, 2178h endasm '-----[Retrieve from DATA table]---------------------------------------------- Offset = 1 @ GetAddress DataTable, _Address Address = Address + Offset ReadCODE Address, DataWord LCDOUT $FE, 1, HEX4 DataWord




Bookmarks