Detailed reference for the TBLWT* instruction in PIC18 ISA.
Store the 8‑bit contents of WREG into the memory location pointed to by the table pointer (TBLPTR) and the table page register (TBLPAG).
TBLPTR and the 8‑bit TBLPAG value.TBLWT, the data in WREG is written to SRAM in the selected table page.TBLPTRL, TBLPTRH (and optionally TBLPTRU for 16‑bit) and setting TBLPAG.TBLWT
; Example 1: Write 0x12 to table address 0x0000 (default page 0)
MOVLW 0x12
TBLWT; Example 1: Write 0x12 to table address 0x0000 (default page 0)
MOVLW 0x12
TBLWT; Example 2: Set table page to 1 and write 0x22 to address 0x0100
MOVLW 0x22
MOVWF TBLPAG
MOVLW 0x00
MOVWF TBLPTRL
MOVLW 0x01
MOVWF TBLPTRH
TBLWT; Example 2: Set table page to 1 and write 0x22 to address 0x0100
MOVLW 0x22
MOVWF TBLPAG
MOVLW 0x00
MOVWF TBLPTRL
MOVLW 0x01
MOVWF TBLPTRH
TBLWT; Example 3: Write 0x44, then read back with TBLRD
MOVLW 0x44
TBLWT
MOVLW 0x00
TBLRD
; Example 3: Write 0x44, then read back with TBLRD
MOVLW 0x44
TBLWT
MOVLW 0x00
TBLRD