print code openmsx-debugger

Por jepmsx

Champion (281)

imagem de jepmsx

25-10-2021, 23:06


Is there a way to print the code in the Code view section of the openmsx-debugger to a txt file?

I'm disassembling a binary file and I would like to write comments on different lines

Entrar ou registrar-se para comentar

Por geijoenr

Champion (392)

imagem de geijoenr

26-10-2021, 00:01

why don't you just use a disasembler? It will do exactly that, turn the binary into a text file you can edit.

Por jepmsx

Champion (281)

imagem de jepmsx

26-10-2021, 10:42

Thanks geijoenr for your answer.

You are right. I was expecting that openmsx-debugger could do it to avoid to learn a new tool (I'm a lazy boy).

Do you have any suggestion for a disassembler?

Por MsxKun

Paragon (1134)

imagem de MsxKun

26-10-2021, 16:11

I used z80dasm on linux and I was happy with the result.

Por thegeps

Paragon (1260)

imagem de thegeps

26-10-2021, 16:23

I've recently used disark and I was fine too

Por wouter_

Hero (535)

imagem de wouter_

26-10-2021, 21:11

I sometimes use this command in the openMSX console (so openMSX itself, not the openMSX-debugger):
disasm <address> <numer-of-lines>
Possibly combined with the command:
save_to_file <filename> <string>
For example:
save_to_file output.txt [disasm 0x4000 500]
It's a bit primitive, but it works.

Por jepmsx

Champion (281)

imagem de jepmsx

27-10-2021, 06:21

Thanks guys for your answers.

First I will try wouter_'s option because it's an environment that I already used.

Thanks again for your help.

Por pgimeno

Champion (328)

imagem de pgimeno

28-10-2021, 02:40

In Linux, the package d52 contains three disassemblers; one of them is for Z80, called dz80. They allow you to write "control files". These are files where you specify the locations of comments etc. and it will generate a disassembly with the comments in it. Basically like IDA but with a text file instead of an UI. SkoolKit is similar and outputs HTML among other things, but for text files, dz80 is more powerful. As you disassemble, if you find out that you made a mistake (e.g. a label name), it's easier to correct it in the control file than all appearances in the whole listing, as there's usually just one place to change. Another advantage is that you don't have to break any copyrights if you distribute just the control file and let people with the ROMs do their own disassembly.

Here's an example control file to disassemble a bootleg version of PacMan: - the project is paused because I have a more important one in my hands right now, but it will give you an idea of what a control file looks like. There's a legend at the bottom of the file.

It's been for years my tool of choice for every disassembly project that goes beyond simple inspection with the debugger. I used it with Thrust II to write the Thrust II Reloaded remake; also with Elite to make a Goat Soup generator, with Mazogs to understand the maze generator, with the Capitán Trueno loader to fix it for certain MSX models, and also with Wriggler, Android Two, Labirint, and now PacMan Bootleg, each for its own reasons.

Por jepmsx

Champion (281)

imagem de jepmsx

28-10-2021, 08:16

Thanks pgimeno for the good explanation of dz80, to learn how you use it it's been very helpful