User guide
Chapter 20
Math Instructions
20–13
Using Arithmetic Status Bits
C always reset
V set if the BCD result is larger than 9999. Overflow results in a minor
error.
Z set if the destination value is zero
S set if the source word is negative; otherwise reset
Math Register (When Used)
Contains the 5–digit BCD result of the conversion. This result is valid at
overflow.
Example 1 (SLC 5/02 Processors Only)
The integer value 9760 stored at N7:3 is converted to BCD and the BCD
equivalent is stored in N10:0. The maximum BCD value possible is 9999.
Destination is displayed as
–26784, decimal
(equivalent to 9760 BCD).
9760
9760
N7:3 Decimal
0010 0110 0010 0000
N10:0 4–digit BCD 1001 0111 0110 0000
F1 F2 F3 F4 F5
ZOOM on TOD –(TOD)– 2.3.0.0.2
NAME: TO BCD
SOURCE: N7:3 9760
DEST: N10:0 –26784
EDT_DAT
9760