flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Excalibur 01 Apr 2025, 04:16
Hi all,
I have a heavy interest in designing high level languages and have made a fairly flexible (but unoptimized) interpreted language in the past, but now am turning to compiled languages. As a project to help learn fasm and compiler design I have made a small (unoptimized) toy language with FASM as the backend I'm calling codecalc, since it only has 64-bit integers and arrays. If anyone would like to check it out the repo is here: https://github.com/Excalibur277/codecalc I've really appreciated the great resources to help learn fasm on these threads, so thanks a bunch. The compiler backend is very unoptimized, with a lot of register spilling, and results in code around 2x slower than compiled c for an equivalent speed test. Main cause for this is that currently expressions always place the resultant in rax (and often push to the stack), and assigned variables are always pushed to the stack, leading to far more memory usage than achievable when tracking registers properly. My next steps will likely be to experiment around with creating a intermediatory language (like LLVM IR) that is platform agnostic so I can experiment with optimizations such as: - Register allocation algorithms to reduce spilling and allow me not to use RAX for everything ![]() - Constant expression precalculation - Look more in depth into writing code that works well with branch prediction. Any thoughts about what else i can improve in my use of fasm would be great. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.