cormacj / rodos-disassembly

This project tracks the disassembly of the Romantic Robot RODOS v2.19 rom and then to correct known bugs.
https://www.cpcwiki.eu/index.php/RODOS
1 stars 0 forks source link

Labels that are unused #10

Closed cormacj closed 3 months ago

cormacj commented 3 months ago

Also why isn't there a good XREF tool for z80 code?

I faked a xref tool using this method:

cat rodos222.asm|awk -F ';' '{print $1}'|grep ":" |grep -v '  '|awk -F ":" '{print $1}'|sort >patterns.txt
cat patterns.txt |awk -F ";" '{print "echo `grep -c "$1" rc.txt` "$1}' >rg.sh
bash rg.sh |sort -nr|grep "^1 "

It reported:

1 sub_f6f5h
1 sub_eeedh
1 sub_e6e5h
1 sub_deddh
1 sub_d6d5h
1 sub_c6c5h
1 lf7b2h
1 lf088h
1 le5e8h
1 lcd00h

These should be just the ones that are defined and never called, but it's possible I culled a comment too much.

cormacj commented 3 months ago

Removed: sub_f6f5h - Generated from a datablock that was decoded as code - https://github.com/cormacj/rodos-disassembly/blob/a343bbdda83433fe3b13d9fca9a524c307a0ef8c/rodos-222/rodos222.asm#L8997-L9017 sub_eeedh - Same block as above sub_e6e5h - Same sub_deddh - Same sub_d6d5h - Same sub_c6c5h - Same

lf7b2h - No existing reference - https://github.com/cormacj/rodos-disassembly/blob/a343bbdda83433fe3b13d9fca9a524c307a0ef8c/rodos-222/rodos222.asm#L8493 lf088h - Was called in a datablock - https://github.com/cormacj/rodos-disassembly/blob/a343bbdda83433fe3b13d9fca9a524c307a0ef8c/rodos-222/rodos222.asm#L7317-L7330 le5e8h - Was part of 27 error block of code. I commented out the rest of the block (might as well save code) lcd00h - No existing reference