print code openmsx-debugger

Door jepmsx

Master (254)

afbeelding van jepmsx

25-10-2021, 23:06

Hi!

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

Aangemeld of registreer om reacties te plaatsen

Van geijoenr

Champion (365)

afbeelding van 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.

Van jepmsx

Master (254)

afbeelding van 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?

Van MsxKun

Paragon (1124)

afbeelding van MsxKun

26-10-2021, 16:11

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

Van thegeps

Paragon (1189)

afbeelding van thegeps

26-10-2021, 16:23

I've recently used disark and I was fine too

Van wouter_

Hero (525)

afbeelding van 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.

Van jepmsx

Master (254)

afbeelding van 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.

Van pgimeno

Champion (328)

afbeelding van 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: https://notabug.org/pgimeno/pacmanbl-dis - 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.

Van jepmsx

Master (254)

afbeelding van 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