here is a c compiler for the hack cpu.
https://github.com/pm100/hack_ccThere are a few sample apps - including tetris !
Note that the code generated by the compiler quite often wont run in the 'legacy' desktop emulator because it uses the free RAM space beyond the screen buffer and the desktop emulator doesnt permit that. The web UI does allow it but that runs too slow to usefully run tetris. I have several other emulators
- there is a WIP IDE , emulator and debugger in
https://github.com/pm100/hackem- there is a simple python emulator in
https://github.com/pm100/hack_cc- there is a standalone c++ emulator using the excellent one lone code pixel game engine in
https://github.com/pm100/hack_olcI also have a 'fixed' version of the desktop ide that allows high RAM addresses
At the moment the main oddness is that an int (16 bits) is not the same size as 2 chars (as required by posix), a char also occupies 1 word so we can address each char in a string. I am working on an option to make a 16 bit int occupy 2 words, so that you can address the ho and lo byte separately