shawty / BBCB_DFS_Catalog

A HTML based mini application, written in JavaScript to allow you to host BBC B Disk images on a website.
The Unlicense
3 stars 2 forks source link

Would be nice if disassembly view supported 65C02 opcodes (Master). #5

Open kieranhj opened 4 years ago

kieranhj commented 4 years ago

E.g. in CORE file in Stunt Car Racer http://bbcmicro.co.uk/explore.php?id=3112 the follow instructions display as ???

2043   da          ???
2044   5a          ???
2045   20 38 22    JSR &2238
2048   7a          ???
2049   fa          ???
204a   ee 5d 21    INC &215d
204d   80          ???
204e   e2          ???
204f   da          ???
2050   5a          ???
2051   20 2b 22    JSR &222b
2054   7a          ???
2055   fa          ???
2056   80          ???

But should be:

 2043   DA         PHX
 2044   5A         PHY
 2045   20 38 22   JSR &2238
 2048   7A         PLY
 2049   FA         PLX
 204A   EE 5D 21   INC &215D
 204D   80 E2      BRA &2031
 204F   DA         PHX
 2050   5A         PHY
 2051   20 2B 22   JSR &222B
 2054   7A         PLY
 2055   FA         PLX
 2056   80 D9      BRA &2031
shawty commented 4 years ago

Added as a nice to have for now :-)

Thanks.

pau1ie commented 4 years ago

I wrote the disassembler. The vast majority of programs on the bbcmicro website are for 6502. I am not sure whether it is possible to detect whether the code is 6502 or 65C02 and behave accordingly. Metadata in the database wouldn't necessarily help as two files on the same disc could potentially be targetted at the different CPUs. Then there is the problem of the undocumented opcodes, which again I chose to ignore. Do you have any idea how to solve this issue?

shawty commented 4 years ago

@pai1ie not just yet no. I believe if you dig through some of JGH's technical doc's he has a couple of possible detection methods, BUT... they do rather depend on running code on the CPU in question to detect them.

I'll have a think though, see what I can come up with.

kieranhj commented 4 years ago

A simpler alternative might be a GUI option, so tick the box if you want to view the disassembly as 65C02, rather than trying to auto-detect?

shawty commented 4 years ago

@kieranhj yes I would agree, simple is always best. There will however always be the small minority that will complain at that and ask "why doesn't it do the work for me" :-)