Hey! I was starting to look at SDCC-generated assembler, and I was not able to find documentation on the generated assembler syntax in the user guide ( http://ecee.colorado.edu/~mcclurel/sdccman_3.6.0.pdf ). There are directives like ".area", syntax like ".area _DABS (ABS)", or even some predefined functions like "___sdcc_enter_ix", that I am not 100% about their semantics. Does any one know any good source on documentation for this?
Thanks in advance!
The assembler is sdas. There's documentation here: http://svn.code.sf.net/p/sdcc/code/trunk/sdcc/sdas/doc/asmln...
Perfect!! Thanks pgimeno!!
Alright, one more weekend, one more version of MDL! I just pushed alpha v9 to GitHub: https://github.com/santiontanon/mdlz80optimizer/releases/tag...
In addition to lots of internal improvements to the optimizer (it generates about 20% more optimizations than the previous release), this release includes support for sdcc output aswell! So, now these dialects are supported: mdl/asmsx/glass/sjasm/tniasm/winape/pasmo/sdcc
I've also enhanced the testing scripts, to make sure MDL gets more and more robust. So, I have a set of 19 open source assembler projects that I use for testing. For example, this table shows how many bytes does MDL (in the default settings) saves off each project. I have similar tables for optimizing for size (-po size) or speed (-po speed):
Project Name bytes saved ------------------------------------- transball (-) 96 Tales of Popolon (-) 44 XSpelunker (-) 49 XRacing (-) 54 Phantomas 2.0 (-) 70 threed (glass) 48 VGMPlay (glass) 96 pong (asmsx) 14 mine (asmsx) 27 robots (asmsx) 7 gmonkey (asmsx) 4 World Rally (asmsx) 40 MetalGear (sjasm) 124 Uridium (sjasm) 64 Deep Dungeon Adventure (sjasm) 23 SCCReplayer4c (sjasm) 13 PyramidWarp Enhanced (tniasm) 63 Subcommander (winape) 119 Flappy Bird (pasmo) 32
Other than 1 million thing sin the to do list (hahaha), there are a few things that I'm unsure about moving forward, and I'd appreciate any feedback any of you might have!
- MDL currently issues "coding style warnings". Currently 3 types are issues: labels without colons, unofficial spelling of Z80 ops, and soem dialect specific (e.g. using reusable sjasm labels which are quite dangerous). But I remember someone did not like the "label without colons" warning. I thought that one is important as otherwise, many assembler lines are very ambiguous, and would parse differently depending on the assembler you use... So, what do you think? should I turn those warnings off by default? and activate via flags, or keep then on and deactivate via flags?
- I have initial SDCC support, but I don't think it's very useful right now, as probably the person using it would have to apply those optimizations manually as MDL does not generate SDCC compatible assembler output yet. So, for any SDCC user reading this, what would be the most useful "ideal" way in which MDL should work with SDCC output?
- Any other open source MSX project that I'm missing in the list above? I wanted to add the Sword of Ianna, but the project is structured in a very complex way (every MegaROM page is a different assembler file, and they are linked manually with a makefile, so, I'd have to run ML separately in each part, which was complicated and I gave up...). The more projects I can use for testing, the more robust MDL can get :)
Anyway, that's all for this week :)
I just found a few other projects searching in github for MSX and filtering by assembly language! I'll be adding these to my test suite this week. I hope they all work first-try! haha
- https://github.com/knightfox75/msx_ngine (asMSX)
- https://github.com/jamque/TPMSX-Engine (asMSX)
- https://github.com/javisasan/msx-pong (sjasm)
- https://github.com/nanochess/z80rogue (tniasm)
- https://github.com/cornelisser/TriloTracker (sjasm?)
- https://github.com/mcolom/boogaboo_disasm_msx (z80asm?)
- https://github.com/nanochess/Zombie-Near/tree/master/20110511 (tniasm)
But again, if anyone knows of other projects that would be interesting to add to my test suite, please let me know! :)
The SDCC support looks interesting, and I would like to try it on RoboPlay (https://gitlab.com/torihino/roboplay), just to see what the effect is. Ideally this would mean only adding an additional step to the make file, making in part of the regular build steps.
Friendly reminder that SDCC already had the peep hole optimizer (e.g.: rather scarce peep-rules.txt example)
Thanks ToriHino for the link, I'll see if I can make the process as seamless as possible!!
And @theNestruo, yes! True. I actually went through the set of peep rules in SDCC at some point to see if there was any interesting one to add to MDL In the couple of example sdcc source code samples people shared with me, MDL was still able to find further optimizations though. So, I think the set of peep rules that come with SDCC is not very comprehensive.
But in any case, the peep-hole optimizer is just the first optimizer that MDL implements. In my mind it was just something quick-n-dirty to start playing with MDL before moving to some search-based techniques, but then it started growing and growing and I still see many more ways to improve it haha
Look at this other project too
https://github.com/cornelisser/TriloTracker-Re-player
It is for sjasm
And @theNestruo, yes! True. I actually went through the set of peep rules in SDCC at some point to see if there was any interesting one to add to MDL In the couple of example sdcc source code samples people shared with me, MDL was still able to find further optimizations though. So, I think the set of peep rules that come with SDCC is not very comprehensive.
I'm not sure I'm getting your point... I'm no SDCC developer, but it seems that you can feed your own peep-rules.txt to the peep hole optimizer.
It is probably less flexible than MDL (namely, the patterns from the latests versions: repetitions, half-values, etc.), but I guess that, beside those, most of the patterns from MDL can be translated to peep-rules.txt syntax.
I'm not against MDL supporting SDCC! Just thinking out loud because I don't understand the excitement about the SDCC support when SDCC already had a similar functionality... ¯\(°_o)/¯
About the other questions: I vote for coding style warnings being disabled by default. "Implicit accumulator syntax"-gang member here...