PIC18 cheatsheet

TBLRD+*

Detailed reference for the TBLRD+* instruction in PIC18 ISA.

Description

Read a byte from program memory using the table read mechanism.

  • The instruction increments the table pointer (TBLPTR) before the read operation (pre‑increment).
  • The byte located at the new TBLPTR address is copied into the table register TBLR.
  • The increment is performed on the full 23‑bit TBLPTR (TBLPTRU:TBLPTRH:TBLPTRL).
  • The result is not automatically transferred to WREG; a subsequent MOVF TBLR, W is typically used to obtain the value in WREG.
  • The instruction has no operands or address options.

Examples

; TBLRD+* – pre‑increment read from address 0x0124 (TBLPTR=0x0123 before)
TBLRD+* ; TBLR = byte at 0x0124, TBLPTR becomes 0x0124
; TBLRD+* – read from start of program memory, TBLPTR=0x0000
TBLRD+* ; TBLR = byte at 0x0001, TBLPTR becomes 0x0001
; TBLRD+* – pre‑increment from a high address 0xFFFFE (TBLPTR=0xFFFFE)
TBLRD+* ; TBLR = byte at 0xFFFFF, TBLPTR becomes 0xFFFFF