"The greatest program ever written"
The above sentence sadly was not written about my program, but I think the blogger is right. All praise to the author of this program. It is not so easy to create anything that can be used in 1 kilobyte. Today's programmers are also concerned with this challenge. Of course this is only on the source code level and the final result is unreadable (for me).
A year ago, when I dealt with the "flicker free" programming technique, thought about rewriting of the "1KCHESS" to run on both platform (ZX80/ZX81). A little sketch was made, but I found too small the remaining free space (559 bytes for code and 68 bytes for data, e.g. stack), so It was not continued. Then the "ISR" occupied all my free time. In august (it was rainy in Hungary) I took out the program again, and re-created it based on this article While the fully-commented source was completed I realized that (with some optimizing) we can free up a lot of space. In step 2 I got more free space reusing the area of the system variables and setting the SP to the top of the available RAM.
The final results are 142 bytes of free space and some functional addons:
1. the outlook was changed a little bit (and the DFILE also became shorter);
2. the input is not in reverse order;
3. the input line may include a cursor character;
4. the original version did not work on an upgraded ZX80, this newer does.
The latter two functions depend on compiler options - so if you don't like the cursor, and if you don't want the owners of the upgraded ZX80 to have the opportunity to play, then you have 142 bytes of free space for the further development (otherwise 129 bytes only).
If anyone can, please help me to find the author to get his blessings to these modifications.