comparison dis.c @ 2274:bf1bb893f104

Properly ignore low bits of SP start address in disassembler
author Michael Pavone <pavone@retrodev.com>
date Thu, 29 Dec 2022 22:44:35 -0800
parents ff726f53d75a
children
comparison
equal deleted inserted replaced
2273:ff726f53d75a 2274:bf1bb893f104
250 } 250 }
251 add_label(context, "user_start", user_start); 251 add_label(context, "user_start", user_start);
252 do_cd_labels = 1; 252 do_cd_labels = 1;
253 } else { 253 } else {
254 uint32_t sub_start =filebuf[0x40/2] << 16 | filebuf[0x42/2]; 254 uint32_t sub_start =filebuf[0x40/2] << 16 | filebuf[0x42/2];
255 sub_start &= ~0x7FF;
255 uint32_t sub_end = sub_start + (filebuf[0x44/2] << 16 | filebuf[0x46/2]); 256 uint32_t sub_end = sub_start + (filebuf[0x44/2] << 16 | filebuf[0x46/2]);
256 if (sub_start > (boot_size - 0x20)) { 257 if (sub_start > (boot_size - 0x20)) {
257 fprintf(stderr, "System Program start offset is %X, but image is only %X bytes\n", sub_start, (uint32_t)boot_size); 258 fprintf(stderr, "System Program start offset is %X, but image is only %X bytes\n", sub_start, (uint32_t)boot_size);
258 return 1; 259 return 1;
259 } 260 }