My aim is to have result disassembly in text
- with labels L+address for jp, jr, call instructions e.g.
jp L32768
- with the same label at place of usage e.g.
L32768: ld a,1
- no address labels for instructions other than jp, jr, call -- no change for original ld a,(32768) instead of ld a,(L32768)
Example of what is expected
Code: Select all
L25399:
LD A,(31841) ; use number, not label
...
CP 1
JR Z,L25450 ; use label instead of address
CP 2
JR NZ,L25529 ; label instead of address
...
JP Z,L27166 ; label instead of address
JR L25529
L25450: ; label for every jr, jp, call target
LD A,90
LD (31865),A
LD BC,(28623)
LD HL,(31851)
LD A,(31856)
AND A
JR Z,L25472 ; label
SBC HL,BC
JR L25473 ; label
25472:
ADD HL,BC
25473:
PUSH HL
LD HL,31849
LD C,16
PUSH BC
Result asm file has some default labels like L24576, L24576_0, L25167, L25167_0, L25399, L25399_0, L25399_1 but they have wrong addresses e.g. L25399 is correst but L25399_0, L25399_1 and others have _wrong_ address. And asm file has labels for ld insctuctions like LD A,(L31841)
What settings should i use to get asm file with correct address labels?
Conversion to skool file:
Code: Select all
python sna2skool.py -c hungry_horace.ctl hungry_horace.sna > hungry_horace.skool
Code: Select all
python skool2asm.py -c hungry_horace.skool > hungry_horace.asm
WARNING: No label for address (31849):
24597 LD HL,31849
WARNING: No label for address (28078):
25029 LD HL,28078
WARNING: No label for address (28078):
25121 LD (28078),HL
WARNING: No label for address (31857):
25126 LD (31857),A
Code: Select all
L25399:
LD A,(L31841) ; this is unwanted usage of label instead of address
DEC A
...
JP Z,L27166
JR L25399_9 ; this label is incorrect
L25399_0: ; another incorrect label
LD A,90
LD (31865),A
LD BC,(28623)
LD HL,(31851)
LD A,(31856)
AND A
JR Z,L25399_1
SBC HL,BC
JR L25399_2
L25399_1:
ADD HL,BC
L25399_2:
PUSH HL
LD HL,31849
LD C,16
L25399_3:
PUSH BC
Code: Select all
LD A,(31841)
DEC A
LD (31841),A
RET NZ
LD A,(31842)
LD (31841),A
LD A,(31865)
JP Z,27166
JR 25529
LD A,90
LD (31865),A
LD BC,(28623)
LD HL,(31851)
LD A,(31856)
AND A
JR Z,25472
SBC HL,BC
JR 25473
ADD HL,BC
PUSH HL
LD HL,31849
LD C,16
PUSH BC