I'm looking for some good working examples of doing disk file I/O operations in assembly language.
Already looked at section 3 DSR (Device Service Routine) / Disk & File Management in the development resources thread.
Lots of good stuff there, but seeing some working code definitely would help.
What I want to accomplish is to create, read, update text files and load binary files.
Basically I'd like to write a small programmer's editor for running on the TI-99/4a.
For keeping things simple and compatible with as many disk devices as possible I would only focus on level 3 I/O calls.
Now here's where things get tricky. I want to use my spectra2 library for most of the stuff.
I learned that scratchpad memory and VDP memory must be setup in a certain way for DSR calls to work successfully.
Currently I'm exclusively using scratchpad memory for all my stuff, so will have to reallocate that to somewhere else.
That should be possible easily enough. Now here are my questions:
1. Does a scratchpad memory map exist, with the minimal requirements for calling DSR routines ?
2. How do I need to setup VDP memory so that file I/O is possible. I understand that a PAB must always reside in VDP memory.
But the disk controller DSR also uses VDP memory for work buffers during file I/O. Does the disk controller DSR always loads files from disk to VDP or is it possible to directly load to RAM ?
3. Is it possible to do file I/O calls in pure assembly language or do I have to involve GPL in some way?
The documentation being focussed on Monitor, Basic, etc. seems to imply that GPL is always involved. Is that a necessity?
4. What is the easiest way to "interface" with DSR memory setup. I mean would have to switch between my "application workspace" outside of scratch-pad memory, into the "DSR workspace" in scratch-pad memory and return safely.
5. Any good examples out there?
On a sidenote, I remember a discussion with InsaneMultitasker many moons ago where it was mentioned that a file operations document was in the works. My memory is a bit blurry on that, can't recall if this was finished or not.