8 extern void __ultobcd (unsigned long v
, unsigned char r
[5]);
11 static const unsigned char u[5] = { 0x##v % 0x100, (0x##v / 0x100) % 0x100, (0x##v / 0x10000) % 0x100, (0x##v / 0x1000000) % 0x100, (0x##v / 0x100000000) % 0x100 }; \
12 unsigned char r[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; \
14 unsigned long bcd = r[4] * 0x100000000 + r[3] * 0x1000000 + r[2] * 0x10000 + r[1] * 0x100 + r[0]; \
15 ASSERT ((#v,(r[0]==u[0]&&r[1]==u[1]&&r[2]==u[2]&&r[3]==u[3]&&r[4]==u[4]))); \
18 void test__ultobcd (void)
20 #if defined(__SDCC_z80)
33 CHECK(16777215); //0x00ffffff
35 CHECK(2147483647); //0x7fffffff
36 CHECK(2147483648); //0x80000000
40 CHECK(4294967295); //0xffffffff