Open pvmm opened 3 years ago
This is correct. The linker implemented in sdcc_msx does not support the initialization of global variables (must be initialized manually). The next generation of linker (https://github.com/MartinezTorres/megalinker) does support them, but it's mostly incompatible with sdcc_msx, so I keep it in a different project.
I found differences between code generated with GCC and SDCC concerning global variables. Global variables in different modules are not properly initialized. Investigating it a little, I think there are some code missing in
crt0msx.32k.4000.s
to move code from INITIALIZER to INITIALIZED. The genericz80/crt0.s
from SDCC has this piece of code aftergsinit
for instance that does exactly that:but there is no equivalent in
crt0msx.32k.4000.s
.