News |
Coming soon! 9060 Blade. |
|
IORLW |
Command:
Syntax:
Status Flags Effected: |
IORLW
IORLW k
Z
|
The IORLW (inclusive or) ORs the contents of the working register
with the lable specified in k and stores the result in the working
register. In other words, if either bit is on in the
literal
k or in the working register, then that bit will be on in the working
register after the operation is complete. The IORLW command
does
effect the zero (z) flag in the STATUS register, so if the resulting
value from the OR command is 0, then the z flag will be set.
The result from an OR command will be zero if both bits in the working
register and the literal are zero, if either bit or both bits are set,
then the result will be set. So:
Working
Register
|
Value
in K
|
Resulting
Value |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
Example 1:
Assume we have a literal named BEFORE with the binary value of
'01010101' and we IOR that with the working register, which
contains the binary value '10101011'. After the IORLW command, the
working register will contain b'11111111'
|
MOVLW
b'10101011'
IORLW BEFORE
|
Copy the binary value '10101011' into the working
register.
IOR the value in the working register with the value in BEFORE.
|
IORWF |
Command:
Syntax:
Status Flags Effected: |
IORWF
IORWF f,d
Z
|
IORWF works just like IORLW, except now the contents of the
working register or OR'd with the register specified by f. If d is is
zero, then the result of the OR will be stored in the working register
and if d is one, the result is stored in the register specified by f.
Code Example 3: The
following code demonstrates ORing a value stored in register REG_BEF
and the contents of the working register (W). |
MOVLW
b'10101010'
MOVWF REG_BEF
MOVLW b'01010101'
IORWF REG_BEF,1
|
Copy the value b'10101010' into the working
register.
Copy the value b'10101010' into the register labeled as REG_BEF
Copy the value b"01010101' into the working register.
IORWF and store the result into the register REG_REF.
|
|
|