IORWF Logic
Bitwise inclusive OR of W and a file register.
| Syntax | IORWF f, d |
|---|---|
| Operands | f: register address 0-127 (bank bits come from STATUS); d: 0 or w puts the result in W, 1 or f puts it back in f |
| Operation | (W) OR (f) → destination |
| Status bits | Z |
| Words / cycles | 1 word, 1 cycle |
| Encoding | 00 0100 dfff ffff |
How it works
IORWF ORs W with register f: a result bit is 1 if either input bit is 1. Use it to set several bits at once. Z is set only if both values were 0.
Example
; IORWF example from picsimulator.com/instructions/iorwf.html
list p=16f84a
include <p16f84a.inc>
org 0
movlw 0xF0
movwf 0x20
movlw 0x0F
iorwf 0x20, f ; 0x20 = 0xFF
The register ends up with all eight bits set.
Open this example in the simulator