Although I've been laid up this past week with a nasty flu I've been busy expanding the functions of my Tachyon system. I wanted to build in a clock-by-clock Prop emulator via the virtual memory layer of the file system and include a disassembler as part of that. Well I started on that interesting road well enough, and then I thought of writing a nice PASM assembler that could take handle Prop tool compatible files etc and then I thought about editing text files on the Prop using an ANSI terminal for display. I also looked at writing HTML to a file(s) via serial on the PC/tablet and have the browser auto-refresh as well.... However the ANSI terminal approach is easier for the moment so I wrote a nice little text file viewer in about 1KB as a prelude to introducing editing functions and at present it displays line numbers, title, position, size etc. BTW, I have the baud rate set at 2M baud for faster screen refresh and function and navigation keys that generate escape sequences are supported too and of course you can escape to the command line to directly access Forth commands.
Now this is the problem, while it is easy enough to delete characters by temporarily substituting them with a suitable non-printing code, it is a different matter when we insert characters as we cannot read the whole file into RAM and it is way too slow to insert character by character directly into a file. My initial thinking is to mark this insertion point with a special 8-th bit character such as $C1 etc, with a unique one for every insertion point. This code can point to a virtual memory buffer where the inserted text is kept and the screen refresh always diverts to and displays these buffers when it encounters an insert code. Whenever the file is saved it basically rewrites the whole file into a new file and uses the old one as a backup.
This is what I'm working on right at the moment but maybe somebody has some experience with doing something similar in a memory constrained system. Ideas?