Compiling Eigenmaths

Other misc things
Post Reply
joaopa
Member
Posts: 46
Joined: Sat Mar 15, 2014 5:42 pm

Compiling Eigenmaths

Post by joaopa »

This project looks very interesting. Having an oldy computer behaving as a TI calculator !! :D

http://eigenmath.cvs.sourceforge.net/vi ... /?view=tar

But I did not manage to compile it. Neither for Spectrum nor VG5000

Can anyone help me to compile?
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

joaopa wrote:Can anyone help me to compile?
I'm always a little worried about size and ram requirements when trying to compile a 32-bit program but you never know until you try it.

zcc doesn't like the .cpp extension so you'll gave to change that to .c. I didn't notice any obvious c++ in there until I tried to translate "symbol.cpp" aka "symbol.c" to assembly. Two functions declared in "prototypes.h" were found to be overloaded:

void decomp(void);
void decomp(int n);

and

void divpoly(void);
void divpoly(int n);

You'll have to disambiguate those by changing their names and then going through all the source to change to the correct function call. You might want to consider changing all the function names to have a scope preamble in their names to identify which source file they belong to but maybe that's not necessary for a quick attempt.

To translate to assembler:

Code: Select all

zcc +zx -vn -O3 -a symbol.c
zcc +zx -vn -SO3 -clib=sdcc_iy --max-allocs-per-node200000 symbol.c
By translating to assembler you don't have to worry about fitting in memory or missing definitions, etc. The first one uses sccz80 and the latter sdcc. sdcc tends to give more information when errors are encountered but line numbers will be all wrong. It's also more fully ansi so it will be able to accept more standard C programs than sccz80. I might use both to narrow down where errors are. The optimization level can be turned down to speed up the translation, especially for sdcc. I tend to leave that there because I also like to look at the quality of asm produced to find out if there is someplace things can be easily improved :)
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Of course the "-a" flag is required for stopping after C translation for both compile lines:

Code: Select all

zcc +zx -vn -a -O3 symbol.c
zcc +zx -vn -a -SO3 -clib=sdcc_iy --max-allocs-per-node200000 symbol.c
cborn
Well known member
Posts: 280
Joined: Tue Oct 06, 2020 7:45 pm

Re: Compiling Eigenmaths

Post by cborn »

just looking around for the ZX calculator INFO
the above link is not working anymore
i found this as eigenmath home
https://georgeweigt.github.io/
Post Reply