Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Bcd2Dec16
Dec2Bcd16
491
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
function Bcd2Dec16(bcdnum : word) : word;
Returns
Converted decimal value.
Description
Converts 16-bit BCD numeral to its decimal equivalent.
Parameters : 
bcdnum
: 16-bit BCD numeral to be converted 
Requires
Nothing.
Example
var a, b : word;
...
a := 0x1234;        // a equals 4660
b := Bcd2Dec16(a);  // b equals 1234
Prototype
function Dec2Bcd16(decnum : word) : word;
Returns
Converted BCD value.
Description
Converts decimal value to its BCD equivalent.
Parameters : 
decnum
decimal number to be converted 
Requires
Nothing.
Example
var a, b : word;
...
a := 2345;
b := Dec2Bcd16(a);  // b equals 9029