Publication 1747-RM001G-EN-P - November 2008
5-2 Data Handling Instructions
Convert to BCD (TOD)
Use this instruction to convert 16-bit integers into BCD values.
With Fixed and SLC 5/01 processors, the destination can only be the math
register. With SLC 5/02 and higher processors, the destination parameter can
be a word address in any data file, or it can be the math register, S:13 and S:14.
If the integer value you enter is negative, the absolute value of the number is
used for conversion.
Updates to Arithmetic Status Bits
The arithmetic status bits are found in Word 0, bits 0 to 3 in the status file.
After an instruction is executed, the arithmetic status bits in the status file are
updated.
TOD
To BCD
Source N7:56
824<
Dest N7:57
0000h<
TOD
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
• •••••
Table 5.2 Processor Function
With this Bit The Processor
S:0/0 Carry (C) always resets.
S:0/1 Overflow (V) sets if the BCD result is larger than 9999. Overflow results in
a minor error.
S:0/2 Zero (Z) sets if destination value is zero.
S:0/3 Sign (S) sets if the source word is negative; otherwise resets.