7-20
Section
Conversion Instructions
453
Flags
ER:
Incorrect digit designator, or data area for destination exceeded.
The source words do not contain ASCII data that can be converted to
hexadecimal, i.e., values ranging from 0 to 9 or A to F.
Indirectly addressed DM word is non-existent. (Content of
*
DM word is
not BCD, or the DM area boundary has been exceeded.)
Example
In the following example, the 2
nd
byte of LR 10 and the 1
st
byte of LR 11 are con-
verted to hexadecimal values and those values are written to the first and se-
cond bytes of IR 200.
@HEX(––)
HR 10
LR 10
00000
200
Address
Instruction
Operands
00000
LD
00000
00001
@HEX(––)
LR
10
HR
10
200
3 1 3 0
LR 10
4 2 3 2
Conversion to
hexadecimal
LR 11
0 0 2 1
200
3 5 3 4
LR 12
0 1 1 0
HR 10
7-20-10 HOURS-TO-SECONDS – SEC(––)
S
: Beginning source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R
: Beginning result word (BCD)
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
000
: No function
000
SEC(––)
S
R
000
@SEC(––)
S
R
000
Limitations
This instruction is available in the
CPM2A/CPM2C only
.
S and S+1 must be within the same data area. R and R+1 must be within the
same data area. S and S+1 must be BCD and must be in the proper hours/min-
utes/seconds format.
DM 6144 to DM 6655 cannot be used for R.
Description
SEC(––) is used to convert time notation in hours/minutes/seconds to an equiv-
alent in just seconds.
For the source data, the seconds are designated in bits 00 through 07 and the
minutes are designated in bits 08 through 15 of S. The hours are designated in
S+1. The maximum is thus 9,999 hours, 59 minutes, and 59 seconds.
The result is output to R and R+1. The maximum obtainable value is 35,999,999
seconds.
Flags
ER:
S and S+1 or R and R+1 are not in the same data area.
S and/or S+1 do not contain BCD.