- Top Stats

Top Posters Top Topic Starters Top Topics
TFM 514
ComSoft612... 313
Gryzor 284
Targhan 174
Ast 161
ComSoft612... 38
TFM 17
arnoldemu 15
Gryzor 12
Devilmarku... 11
BBS software /... - 561496 Views Octoate 21:00, 23 March 10
Arkos Tracker - 32128 Views Targhan 16:56, 20 February 10
SID tracker / ... - 26786 Views BSC 14:35, 05 November 13
SymbOS CPC upd... - 22146 Views Prodatron 00:18, 11 October 16
X-Mass Application - 20836 Views Ast 16:18, 04 March 16


Author Topic: Disark: cross-platform source converter  (Read 401 times)

0 Members and 1 Guest are viewing this topic.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 868
  • Country: fr
  • Liked: 821
Disark: cross-platform source converter
« 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.

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 @ronaldo @Rhino ) 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. 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 :).

« Last Edit: 13:58, 12 May 19 by Targhan »
Targhan/Arkos

Arkos Tracker 2 - alpha 5 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 659
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 1164
Re: Disark: cross-platform source converter
« Reply #1 on: 15:06, 12 May 19 »
I wouldn't say I "complained", but thanks a lot for your work on this. Very appreciated!
Released The Return of Traxtor, Golden Tail, Magica and The Dawn of Kernel for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 868
  • Country: fr
  • Liked: 821
Re: Disark: cross-platform source converter
« Reply #2 on: 18:11, 12 May 19 »
Yeah sorry, you didn't "complain" :). But having to convert by hand the player is a pain. @Arnaud 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.
Targhan/Arkos

Arkos Tracker 2 - alpha 5 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime

Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 593
  • Country: es
    • Fremos Blog
  • Liked: 793
Re: Disark: cross-platform source converter
« Reply #3 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 :) .

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.153
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 630
Re: Disark: cross-platform source converter
« Reply #4 on: 14:37, 16 May 19 »
Can the output be Maxam compatible source code?
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.01.14)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Ver.: 2019.06.18)

Offline norecess

  • CPC464
  • **
  • Posts: 45
  • Country: ca
  • Liked: 108
Re: Disark: cross-platform source converter
« Reply #5 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

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 868
  • Country: fr
  • Liked: 821
Re: Disark: cross-platform source converter
« Reply #6 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.
Targhan/Arkos

Arkos Tracker 2 - alpha 5 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime

Offline norecess

  • CPC464
  • **
  • Posts: 45
  • Country: ca
  • Liked: 108
Re: Disark: cross-platform source converter
« Reply #7 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!

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.153
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 630
Re: Disark: cross-platform source converter
« Reply #8 on: 02:44, 17 May 19 »

Maxam...
Absolutely. There is a profile for that too.
Awesome! I'll give it a go!  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.01.14)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Ver.: 2019.06.18)