Detailed reference for the XORLW instruction in PIC18 ISA.
Exclusive OR the contents of WREG with a literal. The 8‑bit literal is XORed with WREG and the result is written back into WREG. No operand options are available for this instruction.
; XOR a literal with WREG
XORLW 0x55 ; W = W ^ 0x55; XOR a literal with WREG
XORLW 0x55 ; W = W ^ 0x55; XOR with 0x00 (no change)
XORLW 0x00 ; W = W ^ 0x00; XOR with 0x00 (no change)
XORLW 0x00 ; W = W ^ 0x00; Load WREG then XOR with another literal
MOVLW 0x12
XORLW 0x34 ; W = 0x12 ^ 0x34 = 0x26; Load WREG then XOR with another literal
MOVLW 0x12
XORLW 0x34 ; W = 0x12 ^ 0x34 = 0x26