You can take advantage of the fact that BCD is encoded the same as those digits in hexadecimal. So printing the bcd register (an integer) as hex will display it correctly. Converting that hex string as if it is decimal then gives you the normal integer. Some examples:[code]Jython 2.5.3 (, Sep 23 2013, 00:05:54)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_92
Type "help", "copyright", "credits" or "license" for more information.
bcd = 0x456
bcd
1110
hex(bcd)
'0x456'
'%x' % bcd
'456'
decimal = int('%x' % bcd)
decimal
456
bcd2 = int(str(decimal), 16)
bcd2
1110
hex(bcd2)
'0x456'
[/code]