PIC18 cheatsheet

MOVWF

Detailed reference for the MOVWF instruction in PIC18 ISA.

Description

Move the contents of WREG to the file register f.

  • a = 0 → Access‑bank addressing.
  • a = 1 → Banked addressing.

Examples

; a=0 → result stored in f (Access bank)
MOVWF 0x1F, 0 ; 0x1F = W
; a=1 → result stored in f (Banked address)
MOVWF 0x1F, 1 ; 0x1F = W
; Load literal into WREG then move, result in f (Access bank)
MOVLW 0x0A
MOVWF 0x1F, 0 ; 0x1F = 0x0A