Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
Prototype
sub procedure Dec2Bcd(dim dec_num as byte) as byte
Description Function converts 8-bit decimal numeral to BCD and returns the result as byte.
Example
dim a as byte
dim b as byte
...
a = 224
b = Dec2Bcd(a) ' b equals 140 now
5.2.1.7 Bcd2Dec – Converts 16-bit BCD value to decimal
Prototype
sub procedure Bcd2Dec16(dim bcd_num as word) as word
Description Function converts 16-bit BCD numeral to its decimal equivalent and returns the result as byte.
Example
dim a as word
dim b as word
...
a = 1234
b = Bcd2Dec16(a) ' b equals 4660 now
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (13 sur 112)05/11/2004 02:20:52