-// cli_putc((a->info&BIGINT_NEG_MASK)?'-':'+'); /* print sign */
- if(a->wordv[a->length_B-1]<0x10){
- cli_putc(pgm_read_byte(hexdigit_tab_uc_P+a->wordv[a->length_B-1]));
- cli_hexdump_rev(a->wordv, a->length_B-1);
- } else {
- cli_hexdump_rev(a->wordv, a->length_B);
+ size_t idx;
+ uint8_t print_zero = 0;
+ uint8_t *p, x, y;
+ p = (uint8_t*)&(a->wordv[a->length_W - 1]) + sizeof(bigint_word_t) - 1;
+ for (idx = a->length_W * sizeof(bigint_word_t); idx > 0; --idx) {
+ x = *p >> 4;
+ y = *p & 0xf;
+ if (x != 0 || print_zero != 0) {
+ cli_putc(pgm_read_byte(&hexdigit_tab_lc_P[x]));
+ }
+ if (x) {
+ print_zero = 1;
+ }
+ if (y != 0 || print_zero != 0) {
+ cli_putc(pgm_read_byte(&hexdigit_tab_lc_P[y]));
+ }
+ if (y) {
+ print_zero = 1;
+ }
+ --p;