Closed spotlessmind1975 closed 3 years ago
A first version was implemented for the CPU 6502, and the savings were about 10% compared to the size of the original executable. The scheme is to provide, for each function point, two versions of the same code: the first is the inline version (already coded) while the second is the embedded version.
By definition, the embedded have been activated for the following function points:
The activity should be exentended to the remaining CPUs:
Once put to work, the compiler proves to be inefficient from the point of view of the space occupied.
In fact, if we exclude the need to introduce portable mechanisms to differentiate the data memory banks from the code ones, the code itself is not very optimized in terms of size. It is therefore required to introduce an option (
-e
) to allow the use of embedded libraries instead of inline code.Since this implies a deterioration in performance, every single function must be registered with a code, which must be indicated to suggest to the compiler to replace the inline code with a function call.
I.E.:
Where:
cpumul8
: use the embedded (library) version ofcpu6502_fill
instead of inline onecpufill
: use the embedded (library) version ofcpu6502_math_mul_8bit_to_16bit
instead of inline one