![]() |
6502.py , 6809.py, 68000.py, etc. - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Wishlist (https://www.boriel.com/forum/forumdisplay.php?fid=14) +---- Thread: 6502.py , 6809.py, 68000.py, etc. (/showthread.php?tid=499) |
6502.py , 6809.py, 68000.py, etc. - nitrofurano - 09-19-2012 Since z80.py is the essential part of zxbasic-compiler that is used for reference when compiling the resulting .asm into binary, would be a good idea if we start to create similar code for 6502, 6809, 68000, etc., for expanding zxbasic-compiler to other 8bit/16bit platforms? would be this a good start? Re: 6502.py , 6809.py, 68000.py, etc. - boriel - 09-19-2012 The approach for this is to use only one main executable, which loads the corresponding libraries. This is the way ZX Basic is designed. So you should use something like: Code: zxb.py --arch=<architecture name> The compiler then loads the "backend" (the part of the compiler which translates from "Intermediate representation" to machine code of the target architecture), which should be, in these case, python modules like yours. This is not an easy task, though:
Other layers has too much interdependences with each others or with the target architecture (Speccy), which means that changing them is very hard without affecting the whole compiler. This is what I've been working out these days... Re: 6502.py , 6809.py, 68000.py, etc. - nitrofurano - 09-19-2012 Meanwhile, i were starting this 6502.py (far unacurated - i'm not that proficient on 6502) based on z80.py - <!-- m --><a class="postlink" href="http://pastebin.com/G2RJRF9N">http://pastebin.com/G2RJRF9N</a><!-- m --> Ss i can imagine, the rewriting process of zxbasic-compiler is to making it a kind of compiler to z80 only, and then to machines based on that like zx-spectrum, sms, mc1000, msx (still unsuccesfully), amstrad-cpc, pacman-namco (started this as mentioned on another thread, maybe i'm struggling on stack point, interrupts, and so on... - btw, i'm really curious about how simply we can make stuff for arcade machines using zxbasic-compiler! ![]() Thanks to Haroldo O.P (sms port of zxbasic-compiler), he let me know about wla-dx, which made a good effort on targetting a good ammount of different hardware, so i'm also dreaming on see this happening on zxbasic-compiler as well! ![]() And thanks a lot for all your efforts! ![]() Re: 6502.py , 6809.py, 68000.py, etc. - nitrofurano - 09-23-2012 i started this: - <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:68000.py">http://www.boriel.com/wiki/en/index.php ... C:68000.py</a><!-- m --> - <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:6502.py">http://www.boriel.com/wiki/en/index.php ... IC:6502.py</a><!-- m --> |