-static void stat_dump_mem_contents(stat_mem_block_t *memory, uint16_t cols) {
- uint32_t i, j;
- for (i = 0; i < memory->size + ((memory->size % cols) ? (cols - memory->size % cols) : 0); i++) {
- if (i % cols == 0) con_out(" 0x%06X: ", i);
- if (i < memory->size) con_out("%02X " , 0xFF & ((unsigned char*)(memory + 1))[i]);
- else con_out(" ");
-
- if ((uint16_t)(i % cols) == (cols - 1)) {
- for (j = i - (cols - 1); j <= i; j++) {
- con_out("%c",
- (j >= memory->size)
- ? ' '
- : (util_isprint(((unsigned char*)(memory + 1))[j]))
- ? 0xFF & ((unsigned char*)(memory + 1)) [j]
- : '.'
- );
- }
- con_out("\n");
+static void stat_dump_mem_contents(stat_mem_block_t *block, uint16_t cols) {
+ unsigned char *buffer = mem_a(cols);
+ unsigned char *memory = (unsigned char *)(block + 1);
+ size_t i;
+
+ for (i = 0; i < block->size; i++) {
+ if (!(i % 16)) {
+ if (i != 0)
+ con_out(" %s\n", buffer);
+ con_out(" 0x%08X: ", i);