UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
188
Examples
•
If Working Register R3 contains the value
45H
(01000101B) and Working Register
R7 contains the value
02H
(00000010B) (testing bit 1 if it is 0), the statement:
TM R3, R7
Object Code: 72 37
sets the Z flag (indicating bit 1 in the destination operand is 0) and clears the V and S
flags.
•
Working Register R14 contains the value
F3H
(11110011B), Working Register R5
contains the value
CBH
, and Register CBH contains the value
88H
(10001000B)
(testing bits 7 and 3 if they are 0), the statement:
TM R14, @R5
Object Code: 73 E5
resets the Z flag (because bit 7 in the destination operand is not a 0), sets the S flag
and clears the V flag.
•
If Register D4H contains the value
08H
(00001000B), and Working Register R0
contains the value
04H
(00000100B) (testing bit 2 if it is 0), the statement:
TM D4H, R0
Object Code: 74 E0 D4
sets the Z flag (because bit 2 in the destination operand is a 0) and clears the S and V
flags.
•
If Register DFH contains the value
00H
(00000000B), Register 07H contains the
value
1FH
, and Register 1FH contains the value
BDH
(10111101B) (testing bits 7, 5, 4,
3, 2, and 0 if they are 0), the statement:
TM DFH, @07H
Object Code: 75 07 DF
sets the Z flag (indicating the tested bits in the destination operand are 0) and clears
the S and V flags.
•
If Working Register R13 contains the value
F1H
(11110001B), the statement:
TM R13, #02H
Object Code: 76 ED, 02
tests bit 1 of the destination operand for 0, sets the Z flag (indicating bit 1 in the
destination operand is 0) and clears the S and V flags.