[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple IIe and control characters in file names
- Subject: Re: Apple IIe and control characters in file names
- From: dempson@actrix.gen.nz (David Empson)
- Date: 2000/01/03
- Newsgroups: comp.sys.apple2
- Organization: Empsoft
- References: <84oq4l$1ae0$1@node17.cwnet.frontiernet.net>
- User-agent: MacSOUP/2.4.2
David Boyer <david@bvu.edu> wrote:
> As I recall on the IIe, you can use control characters in a filename which
> aren't visible but are part of the filename. You can, however, run a program
> which causes the IIe to display the control characters as inverse
> characters.
>
> Does anyone know how to do this?
Unfortunately it seems that I don't have any notes on how this was done.
I may have the program lurking somewhere on a floppy disk which hasn't
been used in ten or more years, but I wouldn't keep my hopes up.
Beneath Apple DOS at least points to the appopriate area of code in DOS
3.3: the code to display the filename is somewhere between ADD1 and
AE2F.
The patch probably has to do some extra work to get the characters to
display as inverse instead of control characters, assuming the catalog
is being output through the normal character output routine in the
monitor, so I expect it is necessary to jump out of this area of DOS 3.3
into an unused area, do the replacement code to handle control
characters, then jump back again.
> I saved my HighSchool BASIC project on a floppy in the 80's using control
> characters in the filename. I just got a IIe, and now I'd like to open the
> project for nostalgic reasons. It seems like the program we used to use to
> display the control characters was only a couple lines long, but it's been
> 14 years ago!!
Do you have any utility programs like Copy II+, Bag of Tricks or the
Beagle Bros DOS 3.3 utilities (whose name I forget)? You could use one
of these to patch the filename to remove the control characters
(replacing them with normal characters), or even just to find out what
characters were used.
The Beagle Bros utility is best for doing this, because it displays the
catalog sectors in the style of a catalog listing. With a normal sector
editor (Copy II+ or Bag of Tricks) you would have to interpret the
catalog data structures yourself to locate the filename.
In pricinciple, this is pretty easy. You will need to allow for deleted
file entries, so do a NEW, then SAVE TEMP1. Do a CATALOG, and if TEMP1
comes before your protected file then repeat the procedure, saving
TEMP2, TEMP3, etc. until the file comes after your protected one.
Now count how many files appear in the catalog listing before your
protected one. Divide this by seven: the quotient is the number of
sectors you need to skip, and the remainder is the number of file
entries to skip in the sector.
The catalog starts at track 17 ($11 hex) sector 15, and moves back
through track 17 as far as sector 1. Your target sector is therefore
(15 - quotient).
The catalog entries within each sector start 11 ($0B) bytes into the
sector. Each entry is 35 ($23) bytes in length. The filename starts
three bytes after the catalog entry. The following table gives the
start offset for your filename, given the remainder from the above
division:
Remainder Offset to filename
0 $0E
1 $31
2 $54
3 $77
4 $9A
5 $BD
6 $E0
The filename occupies 30 ($1E) bytes starting at this offset.
Normal characters will be in the range $A0 to $FF, while control
characters will be in the range $80 to $9F. Here is a table of the
control characters:
$80 Ctrl-@ $88 Ctrl-H $90 Ctrl-P $98 Ctrl-X
$81 Ctrl-A $89 Ctrl-I $91 Ctrl-Q $99 Ctrl-Y
$82 Ctrl-B $8A Ctrl-J $92 Ctrl-R $9A Ctrl-Z
$83 Ctrl-C $8B Ctrl-K $93 Ctrl-S $9B Ctrl-[
$84 Ctrl-D $8C Ctrl-L $94 Ctrl-T $9C Ctrl-\
$85 Ctrl-E $8D Ctrl-M $95 Ctrl-U $9D Ctrl-]
$86 Ctrl-F $8E Ctrl-N $96 Ctrl-V $9E Ctrl-_
$87 Ctrl-G $8F Ctrl-O $97 Ctrl-W $9F Ctrl-^
Some of these are unlikely to be used in a patched filename, since you
can't type them because of their special editing effects (notably
Ctrl-H, Ctrl-M, Ctrl-U, Ctrl-X and Ctrl-[).
If you don't have any of the above utilities, another option might be to
do a normal CATALOG then use the monitor to examine the contents of the
buffer used by DOS 3.3 to hold the catalog data. This might not work
unless the file is in the last used sector of the catalog. (One way to
get around this: patch DOS so that it pauses after each sector instead
of twenty or so files, then Ctrl-Reset to get out of the catalog.)
Assuming no files are open, DOS 3.3. should used the first file buffer,
which is pointed to by the pair of bytes at 9D00 and 9D01. These
locations should contain DA 9C ($9CDA) if my calculations are correct.
This points to the file name field in the file buffer, which isn't used
for a catalog. Add 34 ($22) to get to the pointer to the data buffer.
Again assuming my calculations are correct, these locations should
contain AD 9A ($9AAD). (I don't have a working Apple II at the moment,
so I can't verify this.)
After a CATALOG command, the last sector of the catalog will be stored
in this data buffer, and you can examine the contents using the monitor,
using the same method described above to determine the offset to the
filename.
--
David Empson
dempson@actrix.gen.nz
Snail mail: P O Box 27-103, Wellington, New Zealand