We used to assume that the address of the FCB entry which was used
for opening a file would be used for later read/write operations, so
we could cache our file-handles keyed on that address.
I've just noticed that multi-file projects in turbo-pascal jump
around with their FCB addresses.
So on open/make file requests we store the original FCB address
in FCB.AL[0,1] - which will be stable across operations, even if
the FCB is in a different address.
I guess we could use file-no instead, but for the moment this seems
simple. If N files are opened from the same FCB address we'll be
in trouble, but we'll cross that bridge later.
Use a better way of keeping track of file-handles
We used to assume that the address of the FCB entry which was used for opening a file would be used for later read/write operations, so we could cache our file-handles keyed on that address.
I've just noticed that multi-file projects in turbo-pascal jump around with their FCB addresses.
So on open/make file requests we store the original FCB address in FCB.AL[0,1] - which will be stable across operations, even if the FCB is in a different address.
I guess we could use file-no instead, but for the moment this seems simple. If N files are opened from the same FCB address we'll be in trouble, but we'll cross that bridge later.
This closes #127.