ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
61
M8C Instruction Set
4.24
Bitwise OR
OR
Computes the logical OR for each bit position using both arguments. The result of the logical OR is
placed in the corresponding bit position for the first argument.
The Carry Flag is only changed when the
OR F, expr
instruction is used. The Carry Flag will be
set to the result of the logical OR of the Carry Flag at the beginning of instruction execution and the
second argument’s value at bit position 2 (i.e., F[2] and expr[2]).
For the
OR F, expr
instruction, the Zero Flag is handled the same as the Carry Flag in that it is
changed as a result of the logical OR of the Zero Flag’s value at the beginning of instruction execu-
tion, and the value of the second arguments value at bit position 1 (i.e., F[1] and expr[1]). However,
for all other
OR
instructions the Zero Flag will be set or cleared based on the result of the logical OR
operation. If the result of the
OR
instruction is that all bits are zero, the Zero Flag will be set; other-
wise, the Zero Flag is cleared.
Note that OR (or AND or XOR, as appropriate) is a read-modify write instruction. When operating on
a register, that register must be of the read/write type. Bitwise OR to a write only register will gener-
ate nonsense.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
OR
A, expr
0x29
4
2
OR
A, [expr]
0x2A
6
2
OR
A, [X+expr]
0x2B
7
2
OR
[expr], A
0x2C
7
2
OR
[X+expr], A
0x2D
8
2
OR
[expr], expr
0x2E
9
3
OR
[X+expr], expr
0x2F
10
3
OR
REG[expr], expr
0x43
9
3
OR
REG[X+expr],
expr
0x44
10
3
OR
F, expr
0x71
4
2
Conditional
Flags:
CF
ZF
Unaffected (unless
F
is destination).
Set if the result is zero; cleared otherwise (unless
F
is destination).
Example 1:
mov
A, 0x00
or
A, 0xAA
;A=0xAA, CF=unchanged, ZF=0
Example 2:
and
F, 0x00
or
F, 0x01
;F=1 therefore CF=0, ZF=0
A
A k
A
A ram k
A
A ram X k
+
ram k
ram k
A
ram X k
+
ram X k
+
A
ram k
1
ram k
1
k
2
ram X k
1
+
ram X k
1
+
k
2
reg k
1
reg k
1
k
2
reg X k
1
+
reg X k
1
+
k
2
F
F k
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...