Hi all,
It's been a while since I've been to the forum, but I've finished my compiler construction class and really enjoyed building the compiler this semester. I'm thinking about building a C compiler for the SNES from scratch. I know that I could use GCC as a base for the compiler, but the source code is a bit archaic. I'd like to make it as close to ANSI C as possible granted the functions are capable on the hardware. I understand things like floating point operations won't work without a math coprocessor. The 65816 has the ability to shell out floating point operations to a coprocessor from what I understand so it could be possible to add support for this later. Also, would it be possible to handle 32 bit integers since the SNES has 16 bit registers? I know that the 65816 can operate in 16 or 8 bit mode but I suppose we could store the low and hi byte in two registers while in 16 bit mode so 32 bit integers could be possible as well. As far as multiplication and division, I understand the SNES has hardware support for those. I remember reading that the CPU cycles required for hardware multiply and divide are not precisely known and thus can't be emulated perfectly. I'll look into implementing bit shifting where possible so that there can be code optimizations on multiplication and division.
If I build all the necessary parts such as scanner, parser, semantic analyzer, escape analyzer, and code generation, would you guys be willing to help with code optimizations and or libraries for the SNES? I'll write the register allocator and liveness analyzer for the compiler as well, but I'm not as familiar with the SNES architecture as I am with the MIPS. Please let me know your thoughts. Thanks much.
It's been a while since I've been to the forum, but I've finished my compiler construction class and really enjoyed building the compiler this semester. I'm thinking about building a C compiler for the SNES from scratch. I know that I could use GCC as a base for the compiler, but the source code is a bit archaic. I'd like to make it as close to ANSI C as possible granted the functions are capable on the hardware. I understand things like floating point operations won't work without a math coprocessor. The 65816 has the ability to shell out floating point operations to a coprocessor from what I understand so it could be possible to add support for this later. Also, would it be possible to handle 32 bit integers since the SNES has 16 bit registers? I know that the 65816 can operate in 16 or 8 bit mode but I suppose we could store the low and hi byte in two registers while in 16 bit mode so 32 bit integers could be possible as well. As far as multiplication and division, I understand the SNES has hardware support for those. I remember reading that the CPU cycles required for hardware multiply and divide are not precisely known and thus can't be emulated perfectly. I'll look into implementing bit shifting where possible so that there can be code optimizations on multiplication and division.
If I build all the necessary parts such as scanner, parser, semantic analyzer, escape analyzer, and code generation, would you guys be willing to help with code optimizations and or libraries for the SNES? I'll write the register allocator and liveness analyzer for the compiler as well, but I'm not as familiar with the SNES architecture as I am with the MIPS. Please let me know your thoughts. Thanks much.