Topic: DMD0016 TOBCD - Integer / Real To BCD |
|
The Integer / Real To BCD (TOBCD) instruction is used to convert a positive Integer or Real (floating point) value to a BCD (binary coded decimal) value. Only the integer portion of a real number will be converted to BCD. Negative values cannot be converted, the result will always be 0.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Input is the numeric memory location that contains the Integer or Real value to convert. This can be any positive constant or any readable numeric memory location.
BCD Output is the numeric memory location to store the BCD result. This can be any writable numeric memory location. Because BCD is unsigned, the result should be placed in an unsigned memory location, for example V memory.
|
|
See Also:
TOBCD - Integer / Real To BCD
|
|
Related Topics:Note: although Do-more CPUs do not natively support BCD, the following two instructions are available for converting data from external communication devices which is formatted as BCD.
PUBLISH - Translate from Do-more
SUBSCRIB - Translate to Do-more
|
|
Rung Example:
|
|