CPCWiki forum

General Category => Applications => Topic started by: Targhan on 13:52, 12 May 19

Title: Disark: cross-platform source converter
Post by: Targhan on 13:52, 12 May 19
Disark is a new cross-platform software (for Windows/Linux/MacOsX) I developed because I needed it for Arkos Tracker 2.

It is a Z80 disassembler/source converter. I have no idea if it's going to interest anyone, but I present it here.
You can check its website here (http://julien-nevo.com/disark/).

Besides the disassembling part, the main goal of Disark is to convert a source into any other assembler's source.
For example, AT2 Z80 sources heavily rely on RASM macros, which are not understood by other assemblers. So the trick is:
- Assemble the player/music with Rasm (this gives a binary and a symbol file)
- Use Disark on the binary to recreate the source, without all the bothersome macros!

This is a solution for the many people that complained (and rightfully so) about the use of Rasm for AT2 (like @reidrac (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1504) @ronaldo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1227) @Rhino (http://www.cpcwiki.eu/forum/index.php?action=profile;u=174) ) and the need to convert the source "manually" into their assembler syntax.

As an example, you can convert something complicated like this:

Code: [Select]
org #1000
        REPEAT 5,counter         ;Ooh, many assemblers don't understand that!
MyLabel{counter}                 ;Wow, generated labels on the fly!
        ld hl,MyLabel{counter}           ;... and a reference to them!
        REND

Into this:

Code: [Select]
org #1000
MYLABEL1 ld hl,MYLABEL1   ;No more complicated macros!!
MYLABEL2 ld hl,MYLABEL2
MYLABEL3 ld hl,MYLABEL3
MYLABEL4 ld hl,MYLABEL4
MYLABEL5 ld hl,MYLABEL5

You get a simple, relocatable source for both music and player!
Predefined profiles allows you to convert the sources to Winape, SDCC, Pasmo, Vasm, Orgams...

How does it work? Disark uses the binary and the symbol file, which contain "semantic labels" to indicate which part of the source is a code area, or a byte area, or a reference area. My player and music sources already contain such "semantic labels", so you don't have to do anything more than the two steps explained above, and this must be done only once.

Of course, if you have the same problem (the need to share sources to other assembler's syntax), you can also use Disark for that purpose.

Everything is explained on the website (http://julien-nevo.com/disark/). You can also check the AT2 player sources to understand how it is done. And don't hesitate to contact me for more information.

Thanks for your attention :).

Title: Re: Disark: cross-platform source converter
Post by: reidrac on 15:06, 12 May 19
I wouldn't say I "complained", but thanks a lot for your work on this. Very appreciated!
Title: Re: Disark: cross-platform source converter
Post by: Targhan on 18:11, 12 May 19
Yeah sorry, you didn't "complain" :). But having to convert by hand the player is a pain. @Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424) did that too! But now the player is getting too complex to do that easily (ROM player, player configuration...). So I hope this new "Disark" tool will help you use the latest player without any trouble.
Title: Re: Disark: cross-platform source converter
Post by: ronaldo on 12:32, 16 May 19
Well, I didn't actually complain. It effectively takes time to do the conversion from one assembler dialect to other, an so that was a thing I planned to do just once, not having to repeat it with different versions.

Of course, a tool like this is very helpful. Thanks for all your work. It is very much appreciated. Hope to be able to integrate AK2 in CPCtelera in next iteration :) .
Title: Re: Disark: cross-platform source converter
Post by: GUNHED on 14:37, 16 May 19
Can the output be Maxam compatible source code?
Title: Re: Disark: cross-platform source converter
Post by: norecess on 16:34, 16 May 19
Fun project you have here!


This reminds me the days where I used to convert .asm files (generated from C compilation with SDCC) to Pasmo-compatible .asm files. High-level code of Phortem demo was created using it. The tool was called "SDCC2Pasmo" back then (reference: http://norecess.cpcscene.net/sdcc-part-3---using-maxam-style-inlined-asm.html).


Of course you project seems to be far more mature that I had accomplished at the time! :D
Title: Re: Disark: cross-platform source converter
Post by: Targhan on 17:16, 16 May 19
Quote
Well, I didn't actually complain.
No you didn't :). No one did... Except those MSX guys :). Anyway I hope this solution proves simple and efficient enough for an integration with Cpctelera.

Quote
Can the output be Maxam compatible source code?
Absolutely. There is a profile for that too.

Quote
This reminds me the days where I used to convert .asm files (generated from C compilation with SDCC) to Pasmo-compatible .asm files
Well actually, the trick is that I don't convert the source (which would very complicated due to the Rasm macros I heavily use) but recreate it from the binary. It makes Disark more opened to any assembler.
Title: Re: Disark: cross-platform source converter
Post by: norecess on 17:33, 16 May 19
I don't convert the source (which would very complicated due to the Rasm macros I heavily use) but recreate it from the binary. It makes Disark more opened to any assembler.



Yeah I understood that!
Title: Re: Disark: cross-platform source converter
Post by: GUNHED on 02:44, 17 May 19

Maxam...
Absolutely. There is a profile for that too.
Awesome! I'll give it a go!  :) :) :)