changeset 2146:0c0d4233d826

Fix SP end address in disassembler
author Michael Pavone <pavone@retrodev.com>
date Sat, 26 Mar 2022 20:10:21 -0700
parents 62a53c052d9b
children 4cd60eecb0b1
files dis.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dis.c	Sat Mar 26 02:01:55 2022 -0700
+++ b/dis.c	Sat Mar 26 20:10:21 2022 -0700
@@ -341,7 +341,7 @@
 				do_cd_labels = 1;
 			} else {
 				uint32_t sub_start =filebuf[0x40/2] << 16 | filebuf[0x42/2];
-				uint32_t sub_end =filebuf[0x44/2] << 16 | filebuf[0x46/2];
+				uint32_t sub_end = sub_start + (filebuf[0x44/2] << 16 | filebuf[0x46/2]);
 				if (sub_start > (boot_size - 0x20)) {
 					fprintf(stderr, "System Program start offset is %X, but image is only %X bytes\n", sub_start, (uint32_t)boot_size);
 					return 1;