A86: String routines
[Prev][Next][Index][Thread]
A86: String routines
I found a slight bug in read_string(). I was reading str.len-2 bytes from
the file, when I should have been reading str.len bytes. However, I was
returning str.len as the length. The result is that the last two bytes read
from the file would end up as random values (most likely 0). This was
probably a carry over from an earlier version, where I was using the length
from the entry header and not from the actual string header.
The size field in the entry header will be two bytes bigger than the length
in the header of the actual string data, to account for the size at the
beginning. If you don't know what I'm talking about, check the structs in
the file :) I derived most of this info from ti86prot.txt (though be
warned, some of the info in that file isn't totally accurate). These
routines can easily be expanded to work with any variable type, as the file
header and entry headers is the same for all types (I'll do it if someone
wants).
Matt: please update these on the ACZ page.
--
David Phillips <david@acz.org>
http://www.acz.org/
TI86X.H