-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimization #476
Comments
Thanks for your interest in this project. Firstly the compiler does produce asm text files, look for files called .dasm in the output folders, for example CSharp-80\Samples\CalcPi\bin\Trs80\Debug\net8.0\CalcPi.dasm. The compiler works by producing assembly code which is then assembled by a z80 assembler. The list file from the assembler is also produced in the output folders, e.g. CSharp-80\Samples\CalcPi\bin\Trs80\Debug\net8.0\CalcPi.lst Using registers rather that the stack to hold local variables, intermediate calculations etc.. is something I have considered. However, the z80 processor has a very limited set of registers and almost every non trivial method would likely end up having to spill data stored in the registers a lot. Note that the compiler will pass parameters in registers in certain limited cases such as when calling intrinsic methods. It is likely that I'll look at inlining before register allocation as this will have much more impact on the ability to use very small methods in C#. It's not clear to me what you mean by "custom" load profiles? There are some compiler options - see the details in ConfigurationOptions class. The compiler is quite usable for the use cases as described in the main readme as is demonstrated by the samples including fully functioning snake game and wumpus game that work on the TRS-80. I'm not sure what you were expecting to be able to accomplish with an 8-bit processor and 64k of addressable RAM but to be honest the compiler has far surpassed what I expected would be possible. |
Modern 8bit computers have memory more than 64kb. ZX-Sprinter (Sprinter-2000) have 4096kb. Or ZX-Evo have 4096kb too. With MMU. 16kb pages (256 pages). |
@SaymanNsk, CSharp-80 doesn't currently have any support for bank switching or other advanced memory models. I have added some information about the memory map here - https://github.com/drcjt/CSharp-80/wiki/Memory-Models. |
@SaymanNsk I've added two separate issues for register allocation and advanced memory models: |
what about register optimization? When calling some functions, it is not necessary to perform a series of pushes. if this is not dynamic loading of arguments or if this is not a large number of arguments, then they can be passed in registers. I would also like to see the assembly in the form of an asm text file. for example, to evaluate code, its correctness and optimality. To be honest, right now this compiler is not very usable.
In addition, there is no possibility to create “custom” load options and usability (for other systems).
The text was updated successfully, but these errors were encountered: