[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: P8/6502 question



dalloff@freenet.columbus.oh.us (Dave Althoff) writes:

| 
| 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)

in P8 under Basic.system, you can BLOAD the file (or a chunk thereof) 
into memory, and peek/poke at it until you don't care any more.  then, 
you can even BSAVE it back out to another file (or, you could just read 
in 128 bytes to a string, print the string to a file, and loop until 
done).

--- email: uwvax!gorgon!ruth!spqr
Mispeling: the plag of our thyme.