Detailed reference for the ADDLW instruction in PIC18 ISA.
Add the literal value k to the contents of WREG. The result is written back to WREG.
; a=0 (Access bank) → W = W + 0x05; a=0 (Access bank) → W = W + 0x05ADDLW 0x05, 0 ; W = oldW + 5ADDLW 0x05, 0 ; W = oldW + 5; a=1 (Banked) → W = W + 0x05; a=1 (Banked) → W = W + 0x05ADDLW 0x05, 1 ; W = oldW + 5ADDLW 0x05, 1 ; W = oldW + 5; Pre-load WREG with literal then add; Pre-load WREG with literal then addMOVLW 0x10MOVLW 0x10ADDLW 0x05 ; W = 0x10 + 5ADDLW 0x05 ; W = 0x10 + 5