Skip to content

Commit 00ba1f3

Browse files
authored
Merge pull request #33 from cormacj/bugfixing
update readme. Minor display tweak on conditional relative jumps
2 parents 867f210 + cec6575 commit 00ba1f3

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,9 @@ S_109: ;
367367
```
368368
# Known Issues
369369
* The disassembler can generate references to labels that don't exist
370+
* Some labels are generated, but never called.
370371
* String detection fails oddly towards the end of a ROM and maybe elsewhere, so use the `generate_string_locations.sh` helper script to make a template if this happens.
372+
* Some code that gets moved around using LDIR won't get properly decoded, because the disassembler doesn't know if its data or code. The recommended workaround is to tell the disassembler what to do using the template options, eg `0xc300,0xc309,c,RELOCATE_BUILTIN_MSG`. This that cause the disassembler treats the data between 0xc300 and 0xc309 as code and assigns the label `RELOCATE_BUILTIN_MSG`
371373

372374
# ToDo
373375

z80-disassembler.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ def findstring(memstart, memend):
11511151
# else:
11521152
# relative_correction=0
11531153
# print("jump:",jump_addr)
1154-
if (jump_addr and jump_addr not in labels): # Its a jump, but area is already data
1154+
if (jump_addr and (jump_addr not in labels)): # Its a jump, but area is already data
11551155
# if jump_addr==0xd8dc:
11561156
# print("----> Mark Handled",hex(jump_addr))
11571157

@@ -1219,17 +1219,17 @@ def findstring(memstart, memend):
12191219
loc = 0
12201220

12211221
if args.labelsfile:
1222-
print(f"Loading labels file: {args.labelsfile}... ",end="")
1222+
print(f"\n Loading labels file: {args.labelsfile}... ",end="")
12231223
load_labels(args.labelsfile)
12241224
print("Done!",end="")
12251225
if args.quiet:
12261226
print("\n")
12271227

12281228
# dump_code_array()
12291229
if args.templatefile is not None:
1230-
print(f"Loading template file: {args.templatefile}...",end="")
1230+
print(f"\n Loading template file: {args.templatefile}...",end="")
12311231
process_template(args.templatefile)
1232-
print(" Done!",end="")
1232+
print(" Done!")
12331233
if args.quiet:
12341234
print("\n")
12351235

@@ -1676,7 +1676,10 @@ def findstring(memstart, memend):
16761676
# if its positive
16771677
tmp=f"{this_opcode} ${oper}{handle_jump(b,program_counter,True)} "
16781678
else:
1679-
tmp = f"{this_opcode} " + lookup_label(jump_addr)
1679+
if "," in this_opcode: # Fixup for JR nz, ADDR so this removes the space if it's a conditional JR
1680+
tmp = f"{this_opcode}" + lookup_label(jump_addr)
1681+
else:
1682+
tmp = f"{this_opcode} " + lookup_label(jump_addr)
16801683
code_output(
16811684
program_counter,
16821685
tmp,

0 commit comments

Comments
 (0)