#include /** * Displays addresses and bytes in RAM * * @param addr - the first byte to show * @param bytes - the number of bytes to show * @param highToLow - if true (!=0), prints higest-address byte first * @param base - 8 for octal, 10 for decimal, else hexadecimal */ void showMemory(void *addr, size_t bytes, int highToLow, int base) { const char *format = (base == 8) ? "%p: %03o\n" : (base == 10) ? "%p: %3d\n" : "%p: %02x\n"; if (highToLow) { for(unsigned char *p = addr+bytes-1; ((void *)p)>=addr; p-=1) { printf(format, p, *p); } } else { for(unsigned char *p = addr; ((void *)p)