IORLW Logic

Bitwise inclusive OR of W with an 8-bit constant.

SyntaxIORLW k
Operandsk: 8-bit literal 0-255 (0x00-0xFF)
Operation(W) OR k → W
Status bitsZ
Words / cycles1 word, 1 cycle
Encoding11 1000 kkkk kkkk

How it works

IORLW sets the bits of W that are 1 in k. IORLW 0 changes nothing but sets Z when W is 0, a quick way to test W.

Example

; IORLW example from picsimulator.com/instructions/iorlw.html
    list p=16f84a
    include <p16f84a.inc>

    org 0
    movlw 0x05
    iorlw 0x30        ; W = 0x35, the character '5'

W becomes 0x35, the ASCII code for 5.

Open this example in the simulator

Related instructions