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

Re: Using all 128 K



In article <9f61cf69.0206261657.797d14ac@posting.google.com>, 
ludditetech@mac.com (Simon Williams) wrote:

> If I'm sequencially BLOADing different files to the same location (ie:
> in the HiRes area), do I need to first 'clear' the memory?
> I'm using sets of audio samples in my program. I've managed to get
> them all to fit between $2000 and $5200, and it works on the first
> go-round, but when I BLOAD a second set to the same location in memory
> things get funny (like BREAK IN 65014 when I enter RUN and other
> similar oddities). I'll hazard a guess that I'm somehow stepping on
> BASIC.SYSTEM.
> I haven't tried the RAM disk approach, but I think it may be too slow
> for what I'm after.
>
> SW
>
> PS: I've come across a lot of books that teach beginners level
> APPLESOFT, but nothing for the 'intermediate hackist'... can anyone
> suggest anything? (I noticed Amazon still carries a lot of A2 books,
> but their descriptions are vague at best).

How big is your BASIC program? BASIC programs are stored starting at $800
and work their way up. Numeric variables are stored after the end of the
program. Strings are stored at the top of free memory, normally $9600, and
work their way down. Unfortunately BASIC has no idea if you're using any of
that memory between $800 and $9600 and will try to use it too.

To check if your program is intruding past $2000, just type HGR, then LOAD
the program. Since hi-res page 1 uses the memory from $2000 to $3FFF, if you
see anything appear on the graphics screen then your program is too big and
is intruding into the same memory you're later loading data into. If the
screen stays clear try running the program, but remove any lines that load
in data to the hi-res buffer. If the variables the program creates are going
past $2000 you'll be able to see them changing on the screen.

If this is your problem there are two commands, LOMEM and HIMEM, which set
the lower and upper memory limits for BASIC. This allows you to set aside a
buffer so BASIC won't intrude on it. I've never had to use them, if you need
more info on them I'm sure I've got a book here which describes their use,
just ask!

--
Roger Johnstone, Invercargill, New Zealand

Apple II - FutureCop:LAPD - iMac Game Wizard
http://homepage.mac.com/rojaws
________________________________________________________________________
"But what is it good for?"
    Engineer at the Advanced Computing Systems Division of IBM
    commenting on the micro chip, 1968