From: iAN CooG on
rusure <r_u_sure(a)mybluelight.com> wrote:
> That's commonly done in BASIC programs without a need for NEWing or
> CLRing. The only need for a NEW operation is if you need to edit a
> BASIC program after loading ML above the current top of BASIC. After
> BASIC programs LOAD ML programs, they continue processing from the
> beginning of the BASIC code. Without checking to see if the ML has
> been LOADed, the BASIC program will LOAD the ML over and over.
> Usually BASIC that LOADS ML looks like this:
>
> 10 if i > < 0 then 500
> 100 i=1
> 200 load"stub",8,1
> 500 rem rest of program
>
> When line 10 is first executed, the value of i is 0. i is set to 1 in
> line 100. stub is LOADed in line 200. The program continues
> processing in line 10 with 1 as the value of i. The conditional
> transfer of control is made to a line after the LOAD of the ML.

Loading from inside the basic program doesn't set basic pointers.

start tok64 test1.prg
10 if a=0 then a=1:load"ml4000-9fff",8,1
20 input "check memory now";d$
30 goto 20
stop tok64

ml4000-9fff is just a file of $6000 bytes filled with $60 for testing.

After loading and when the 1st input appears, enter monitor and check
basic pointers:

m 2b
>C:002b 01 08 5e 08 65 08 65 08 00 a0 00 a0 00 a0

m 4000
>C:4000 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60

m 9ff0
>C:9ff0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60

everything got loaded BUT the pointers are left where they are.

Temporary strings WILL be build at end of memory ($9fff and backwards)
and your variables/arrays WILL overwrite $4000 onward if you don't
block the basic memory inside a cage.

now exit monitor, enter a string on the input and reenter monitor

m 2b
>C:002b 01 08 5e 08 6c 08 6c 08 e8 9f << LOOK

>C:9ff0 20 31 32 33 20 31 32 33 20 54 45 53 54 49 4e 47 123 123
TESTING

see? just set $33-38 (and not only $37-38) to $4000 and you're safe.

lda #<$4000
ldx #>$4000
sta $33
stx $34
sta $35
stx $36
sta $37
stx $38


--
-=[]=--- iAN CooG/HVSC & C64Intros ---=[]=-


From: iAN CooG on
Jonno Downes <jonnosan(a)gmail.com> wrote:
> Hi,
>
> I want to load a M/L "stub" into RAM - the stub is too big to fit into
> $c000-$cfff so I am loading it in to $4000
> I thought I could just reduce MEMSIZ ($37/$38) and call CLR but after
> doing that, I get a "?OUT OF MEMORY ERROR" whenever I try and add a
> line of BASIC text.

check what's the final address of your basicprogram, let's assume it loads
$0801-$1234, then let exomizer do the work for you.

exomizer sfx basic,$0801,$1234,$3fff basicprogram.prg mlprogram.prg -o
final.prg -n

--
-=[]=--- iAN CooG/HVSC & C64Intros ---=[]=-
The world isn't flat, it's Gouraud shaded.