
Application Note
Four New Signed Branch Instructions, Detail
AN1218 Rev. 2
25
operations of high level languages such as C. Also, the representation
of signed numbers and their operations can easily be computed. This
can be especially helpful with digital signal processing algorithms and
the proper storage of signed analog to digital readings.
Four New Signed Branch Instructions, Detail
All the new CPU08 instructions that affect signed branching are listed
below. Examples for these instructions are given in
Appendix I — New
CPU08 Signed Branch Instruction Examples
.
BGE
Branch if Greater Than or Equal (signed operands)
PC
←
(PC) + $0002 + Rel, if (N
⊕
V)=0,
i.e., if (A) _ (M), ("signed" numbers)
Operation:
Description: If the BGE instruction is executed
immediately after execution of any of the
compare or subtract instructions, the branch
will occur if and only if the two's complement
number represented by the appropriate
internal register (A, X, or H:X) was greater
than or equal to the two's complement
number represented by M.
BGT
Branch if Greater Than (signed operands)
PC
←
(PC) + $0002 + Rel, if Z+(N
⊕
V)=0,
i.e., if (A) > (M), ("signed" numbers)
Operation:
Description: If the BGT instruction is executed
immediately after execution of any of the
compare or subtract instructions, the branch
will occur if and only if the two's complement
number represented by the appropriate
internal register (A, X, or H:X) was greater
than the two's complement number
represented by M.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.