Print hex numbers actually properly this time.

This commit is contained in:
David Given 2016-08-20 14:02:12 +02:00
parent 204f932ed2
commit f561b94b49
2 changed files with 11 additions and 10 deletions

View file

@ -25,6 +25,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "out.h" #include "out.h"
#define ASSERT(x) switch (2) { case 0: case (x): ; } #define ASSERT(x) switch (2) { case 0: case (x): ; }
@ -453,11 +454,11 @@ int main(int argc, char* argv[])
{ {
long ss = 0; long ss = 0;
printf(" address length\n"); printf(" address length\n");
printf(" ehdr : %08lX %08lX\n", outsect[TEXT].os_base & ~0x1FFF, codeoffset); printf(" ehdr : %08"PRIx32" %08"PRIx32"\n", outsect[TEXT].os_base & ~0x1FFF, codeoffset);
printf(" text : %08lX %08lX\n", outsect[TEXT].os_base, outsect[TEXT].os_size); printf(" text : %08"PRIx32" %08"PRIx32"\n", outsect[TEXT].os_base, outsect[TEXT].os_size);
printf(" rom : %08lX %08lX\n", outsect[ROM].os_base, outsect[ROM].os_size); printf(" rom : %08"PRIx32" %08"PRIx32"\n", outsect[ROM].os_base, outsect[ROM].os_size);
printf(" data : %08lX %08lX\n", outsect[DATA].os_base, outsect[DATA].os_size); printf(" data : %08"PRIx32" %08"PRIx32"\n", outsect[DATA].os_base, outsect[DATA].os_size);
printf(" bss : %08lX %08lX\n", outsect[BSS].os_base, outsect[BSS].os_size); printf(" bss : %08"PRIx32" %08"PRIx32"\n", outsect[BSS].os_base, outsect[BSS].os_size);
ss += outsect[TEXT].os_size; ss += outsect[TEXT].os_size;
ss += outsect[ROM].os_size; ss += outsect[ROM].os_size;
ss += outsect[DATA].os_size; ss += outsect[DATA].os_size;

View file

@ -303,11 +303,11 @@ int main(int argc, char* argv[])
{ {
long ss = 0; long ss = 0;
printf(" base : "PRIu32"\n", outsect[TEXT].os_base) ; printf(" base : %08"PRIx32"\n", outsect[TEXT].os_base) ;
printf(" text = "PRIu32"\n", outsect[TEXT].os_size); printf(" text = %08"PRIx32"\n", outsect[TEXT].os_size);
printf(" rom = "PRIu32"\n", outsect[ROM].os_size); printf(" rom = %08"PRIx32"\n", outsect[ROM].os_size);
printf(" data = "PRIu32"\n", outsect[DATA].os_size); printf(" data = %08"PRIx32"\n", outsect[DATA].os_size);
printf(" bss = "PRIu32"\n", outsect[BSS].os_size); printf(" bss = %08"PRIx32"\n", outsect[BSS].os_size);
ss += outsect[TEXT].os_size; ss += outsect[TEXT].os_size;
ss += outsect[ROM].os_size; ss += outsect[ROM].os_size;
ss += outsect[DATA].os_size; ss += outsect[DATA].os_size;