Specifications
Instruction Z condition C condition
NEG Rd
Rd = 0 Rd > 0
NOT
opaque
−
OR
result = 0
−
ORC #k, CCR
Z or (bit 2 of k) C or (bit 2 of k)
POP, PUSH result = 0
−
ROTL, ROTR, ROTXL, ROTXR opaque opaque
RTE (see note below), RTS,
SLEEP, STC
− −
SUB.B Rd, Rs
SUB.W Rd, Rs
Rd = Rs Rd < Rs
SUBS
− −
SUBX
opaque opaque
XOR
Rd = Rs
−
XORC #k, CCR
Z xor (bit 2 of k) C xor (bit 0 of k)
Note that RTE is modelled as having no effect on the CCR, although in fact RTE pops the CCR
from the stack. The model corresponds to the fact that the entire execution of the exception
handler that ends with RTE preserves the original value of the CCR.
5.5 Conditional branches and the "-bcc" Option
The conditional branch instruction Bcc supports 16 branch conditions which are logical
combinations of the CCR condition flags N (negative), Z (zero) and V (overflow). These 16
codes fall into five groups:
• the two conditions for "always true" and "always false";
• the two conditions for equality or inequality;
• the four conditions that reflect comparison of unsigned integers;
• the four conditions that reflect the same comparisons of signed integers; and
• the four conditions for "plus" or "minus", and overflow or no overflow.
Since Bound-T only models unsigned computation on the H8/300, the condition codes for
signed comparison are considered opaque by default. However, this will usually prevent
Bound-T from finding bounds for loops that use signed counter types, such as the 'C' language
"int" type, even if the counters only take on non-negative values and the loop could as well use
the corresponding unsigned type such as the 'C' language "unsigned int" type. To work around
this problem, the command-line option -bcc=unsigned makes Bound-T interpret the signed
conditions as equivalent to the corresponding unsigned conditions. This option should be used
only when the counter values stay in the non-negative signed range (0 .. 127 for 8-bit
counters, 0 .. 32 767 for 16-bit counters).
The table below shows how Bound-T models the Bcc condition codes under the two possible
values for the -bcc option. The option changes the interpretation only for the signed
comparison conditions.
Bound-T for H8/300 Supported H8/300 Features 27