[comp.sys.apple2] Accessing extra 64K

rjd@alpha.sunquest.com (Robert Dull) (03/21/91)

Greetings all,

Time to delve into the archives.  I need to load a text file into the
extended 64k on an Apple IIe.  How can I do this and then access it
from Applesoft?  Thanks.

_____________________________________________________________________
no fancy signature here and my views reflect nothing at all
---------------------------------------------------------------------

dmag@caen.engin.umich.edu (Daniel Demaggio ) (03/21/91)

In article <20MAR91095547@alpha.sunquest.com> rjd@alpha.sunquest.com writes:
>Time to delve into the archives.  I need to load a text file into the
>extended 64k on an Apple IIe.  How can I do this and then access it
>from Applesoft?  Thanks.
>
  Oh, boy, that's a whole can of worms.. I can see 2 ways to do it: 
 1) Use ML routines to pull stuff into main memory (actually, there
are some helpful but slow ROM routines built in to your 80-col card for
this..) Basic gets temporarily switched out when you access the 2nd
64K, so you cannot do it directly from basic.. 
2) use ProDOS: Copy the file to /RAM with your basic program, then
it can access it at relativly fast speeds, using ProDos commands [for
example, you could consider the text file one big array, and load in the
bytes (if you know them by number) with the BLOAD file,A$__,L$__,B$__ command
(where you specify where in main memory to put it[A], how long it is[L],
and at what position in the file the bytes are[B])]
 In order to copy the file to /RAM from basic, do something like this:

10 for b = 0 to filelen step free
20 ? chr$(4);"BLOAD TEXTFILE,TTXT,A";mem;",L";free;",B";b
30 ? chr$(4);"BSAVE /RAM/TEXTFILE,TTXT,A";mem;",L";free;",B",b
40 next b

Where free is the number of free bytes at the location mem (in main mem)
and filelen is the length of the file in bytes.  For example, free can be
40 (I forget the exact #) and mem = 768 (=$300).. This copies the file
in increments of 40 bytes..  If you are still having trouble or have Q's
feel free to E-Mail me.  -=DAN=-

--
-----                           _______   
Dan DeMaggio                   | DON'T |  WHILE you <> understand           
dmag@caen.engin.umich.edu      | PANIC |    REREAD (this)        
CAEN Apollo Systems Programmer |__(!)__|  ENDWHILE