[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Binary vs. text



BTW, I've changed the name of this thread.
I don't know of any *fundamental* difference between binary files and text files. That is, both use the same basic units--0 to 255 (decimal) or 00 to FFhex or 00000000 to 11111111 binary.
Now maybe this is in some sense no longer true with 16-bit, 32-bit, and
64-bit architectures. But still, both text and instructions are series of
0s and 1s, however long. And a byte is still 8 bits, right?
The difference between a text file and a "binary" file (a misnomer--both
are binary) as I understand it, lies in how the bytes are interpreted by
the program that operates on them. XyWrite tries to interpret the bytes as
text characters and symbols, according to the ASCII (or ANSI) character
sets. If you take a Xy "text" file and rename it to have an .EXE extension,
DOS will try to execute the "text" (i.e., binary) bytes as if they were
instructions. Indeed, some "text" symbols will be read as
instructions--e.g., C3 shows up in Xy as a vertical line with a little
horizontal part coming off the middle, but C3 in Assembler, as I recall, is
a Jump instruction.
Isn't the idea that data and instructions are the same kind of storable
things (bytes) the basic idea of the computer? A byte is a byte is a byte.
Programs and text files are encoded, stored, and loaded by the same mechanisms.
None of this means that there aren't crucial differences *at some lesser
level of abstraction* between text files and executable files. So my
original question amounts to: at what level of abstraction? E.g., does the
DICT.SPL file have fixed-length fields or records? That would differentiate
it from text files (but not from some database files).


Harry Binswanger
hb@xxxxxxxx