Skip to content

Commit 1163231

Browse files
committed
Fix for labelling after update equ
1 parent 8b032bc commit 1163231

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

z80-disassembler.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ def load_labels(filename):
327327
# print("in code",hex(addr))
328328
# update_label_name(addr,"C")
329329
code[addr][2]=lname
330+
code[addr][3]=lname #Overwrite string defs
331+
template_labels[addr]=lname #and template label
330332
# print("Lookup:",lookup_label(addr))
331333
elif lname[0]!=";":
332334
extern_labels[addr].append(lname)
@@ -807,8 +809,6 @@ def lookup_label(addr, prettyprint=""):
807809
Returns:
808810
Formatted String
809811
"""
810-
# if addr==0xccd1:
811-
# print(code[addr])
812812
if not is_in_code(addr):
813813
debug("-->Not in code")
814814
if addr in extern_labels:
@@ -1421,11 +1421,11 @@ def findstring(memstart, memend):
14211421
if (program_counter in template_labels):
14221422
labelname=template_labels[program_counter]
14231423
# if labelname[0]=="0":
1424-
# print("1 used")
1424+
# print("1 used")
14251425
else:
14261426
labelname=lookup_label(program_counter,1)
14271427
# if labelname[0]=="0":
1428-
# print("2 used")
1428+
# print("2 used")
14291429

14301430
if code[program_counter][1]=="C":
14311431
stats_c_labels=stats_c_labels+1
@@ -1447,6 +1447,7 @@ def findstring(memstart, memend):
14471447
for tmp in labels[program_counter]:
14481448
tmp_str=tmp_str+f'{hexstyle}{tmp:X} '
14491449
do_write(tmp_str)
1450+
14501451
else:
14511452
do_write(
14521453
";----------------------------------------------------------------------------"

0 commit comments

Comments
 (0)