[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
P8/6502 question
Okay, I should probably take this to c.s.a2.programmer, but my site
doesn't carry that group and posting to it is a pain...
I'm writing a program in Applesoft to process text files. In an effort to
make it nice and friendly, I've written the program to handle any of the
three major types of line-turn (c/r, c/r-l/f, l/f), and because I have no
idea what characters may appear in a line, I must use an input routine
which reads characters one at a time.
Right now, the program works beautifully. But I am not satisfied.
I'm presently using an Applesoft routine which uses GET to build a string
for each line. First, this is slow because each instruction in the input
loop must be interpreted by Applesoft. Second, this slows down the whole
computer because all this string manipulation leaves a lot of garbage behind.
I want to re-write the input routine in 6502. Under DOS 3.3, I can open a
file using Applesoft, then issue a READ instruction, then my 6502 program
can collect characters from the file by calling RDCHAR (which calls
the DOS character input routine pointed to by KSW). Does this work in P8,
or do I have to locate and read the buffer manually?
Also, (I know, I COULD look this up...but this is faster and easier!) once
I read a string into the input buffer ($200), how can I transfer it into
an Applesoft string from 6502? In other words, how can I find Q1$ and
assign the data in the buffer to it. If it helps, I'm limiting the input
string to 81 characters.
Any assistance welcome; thanks in advance!
--Dave Althoff, Jr.
--
/-\ _ _ __|\
/XXX\ /X\ /X\_ _ /XX\_\
/XXXXX\ /XXX\ _/XXXX\_ /X\ /XXXXX <(hard hat area... )
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXXo(.sig under construction)