Detailed reference for the SUBFWB instruction in PIC18 ISA.
Subtract the contents of file register f and the borrow flag from WREG.
d = 0 → result stored in WREG.d = 1 → result stored back into register f.a = 0 → Access bank addressing.a = 1 → Banked addressing.; d=0, a=0 → result in WREG, Access bank
SUBFWB 0x20, 0, 0 ; W = W - 0x20 - borrow; d=0, a=0 → result in WREG, Access bank
SUBFWB 0x20, 0, 0 ; W = W - 0x20 - borrow; d=0, a=1 → result in WREG, Banked address
SUBFWB 0x20, 0, 1 ; W = W - 0x20 - borrow (banked); d=0, a=1 → result in WREG, Banked address
SUBFWB 0x20, 0, 1 ; W = W - 0x20 - borrow (banked); d=1, a=0 → result back to file register, Access bank
SUBFWB 0x20, 1, 0 ; 0x20 = W - 0x20 - borrow; d=1, a=0 → result back to file register, Access bank
SUBFWB 0x20, 1, 0 ; 0x20 = W - 0x20 - borrow; d=1, a=1 → result back to file register, Banked address
SUBFWB 0x20, 1, 1 ; 0x20 = W - 0x20 - borrow (banked); d=1, a=1 → result back to file register, Banked address
SUBFWB 0x20, 1, 1 ; 0x20 = W - 0x20 - borrow (banked); Load literal into WREG then subtract with borrow, result in WREG (Access bank)
MOVLW 0x07
SUBFWB 0x05, 0, 0 ; W = 0x07 - 0x05 - borrow; Load literal into WREG then subtract with borrow, result in WREG (Access bank)
MOVLW 0x07
SUBFWB 0x05, 0, 0 ; W = 0x07 - 0x05 - borrow