I am curious if anyone has written a C++ compiler in Z80 assembly for the MSX?
I would love to take a peek at that code for a project that I am currently working on.
Thanks up front
!login ou Inscrivez-vous pour poster
I am curious if anyone has written a C++ compiler in Z80 assembly for the MSX?
I would love to take a peek at that code for a project that I am currently working on.
Thanks up front
Not exactly what you are asking for but you can take a look at this post maybe:
https://msx.org/forum/msx-talk/development/z80babel-c-d-rust...
I was thinking something along the line of a C++ compiler that is native to the MSX written in Z80 with source.
No libraries other than the standard STDIO and the like if I can remember
C++ is a very complex language. You can't even think about writing a compiler for it on a Z80. Not even a parser. There is only one or two (quite limited) C compilers written for MSX... and that's it. And C++ is several magnitudes more complex.
Better go for cross compilation...
Why would you be interested in this? Care to explain?
I'm not even sure if c++ cross compiling would worth the trouble... There is a lot of overhead for a puny 3.58MHz z80 and 64KB memory, performance probably wouldn't be great and it would consume much memory...
Thanks everyone for their answers.
Now, is there a C++ compiler written in Z80 with source for the MSX or any other Z80 based system.
Even if it was written for CP/M and I can convert it from 8080? To Z80
No, it does not exist.
There is not even a proper C++ compiler for Z80 on PC. There are some attempts here and there, but they are incomplete afaik.
So for the time being C is the best you can do.
No, it does not exist.
There is not even a proper C++ compiler for Z80 on PC. There are some attempts here and there, but they are incomplete afaik.
So for the time being C is the best you can do.
OK, how about just plain C.
I know there is a C compiler that will output Z80 code because they do it over at Atari Age all the time for the Colecovision. Just that it is SDCC for Windows.
Then again, it's not a native Z80 written compiler.
I guess I will have to write it from scratch then right Gov'Na...
40 years of MSX and you would think that it was done by now. First time for everything I hear.
SDCC is multi-plateform (not just Windows) and even if it target not only the z80, it generate good assembler code (especially with its new calling convention).
If you want a z80 only compiler, check z88dk.
There are a few limited C compilers for MSX. The best one is probably ASCII's MSX-C. Check generation MSX for several others.
- Hi-Tech C for CP/M
- BDS C
- GST C
Note that this says C++ compiler: https://www.generation-msx.nl/software/hisoft/c-compiler/2492/
But it's just a C-compiler with some extras. (Dunno what though...)
I can't imagine even how much memory would eat supporting all OOP features and others things that C++ had over plain C. Think about templates, virtual table dispatched methods and every other kind of feautures. a simple C++ code with one virtual class targeting z80 asm would probably result in a huge machine code size with horrible performances.....
Try to imagine the size of a simple copy constructor code with 10 members to manage.....
As an experiment one could try to compile C++ code to plain C code (there are c++ compilers that can do this) and try to compile the result with SDCC to have an idea of how would the asm code will be in size and performances.
Don't you have an account yet? Become an MSX-friend and register an account!