How do I protect an ML routine in BASIC if the routine isn't mine?

How do I protect an ML routine in BASIC if the routine isn't mine?

Post by Mathy van Nisselro » Thu, 28 Mar 2002 21:29:11



Howdy folks

I've stumbled onto a problem while trying to debug CD Audio Player (CDAP).

CDAP is getting so close to the ASPI manager in memory, that TurboBASIC
overwrites part of the manager.  How do I protect the manager if I can not
change the location or format of the manager.

(I just sent Matthias a message to ask him if it is possible to relocate the
manager)

I could stuff the ML code into a BASIC string, but I want to use the manager
as is and no create a version that is 'BASIC only'.

I looked into declaring a string around the manager (from $8000 to $8800),
but (Turbo)BASIC keeps moving these string in memory.

Please help.

CU                            Mathy van Nisselroy

--
---
My old email address will cease to exist as of the end of 2001, please use
my new address.
Meine alte Emailadresse wird Ende 2001 geloescht, bitte benutzen Sie meine
neue Adresse.
Mijn oude Emailadress wordt eind 2001 opgeheven,  gebruikt aub vanaf nu mijn
nieuwe adres.

http://www-users.rwth-aachen.de/mathy.van_nisselroy

 
 
 

How do I protect an ML routine in BASIC if the routine isn't mine?

Post by Ron Hamilto » Fri, 29 Mar 2002 08:03:52


You have one possible option in addition to relocate ASPI or condense CDAP,
assuming TB uses memory similar to Atari Basic. TBasic starts with MEMLO at
$3629 and builds the statement table up from there followed by string array
space and runtime stacks.

Where is RAMTOP and the display RAM, and what is FRE(0)? You may be able to
allocate your DIMmensioned resources creatively to near $8000 and then DIM a
never used dummy string a little over 2K to get past $8800 and then allow TB
to have what is available up to the display list.

Or it might be as simple as Poke RUNSTK (142-143) and MEMTOP (144-145) to
$8801 *if* your strings all fit below $8000 and there is enough room above
$8800 and below the display list. This Poke must be *after* any edit of
Basic statements and *after* DIM of all strings/arrays. It must also be
under program control and before any Gosub or For/Next statement.

The 2K dummy string method is safer, and should not be affected by Dos
configuration differences if using TBasic. Any direct manipulation of memory
usage apart from RAMTOP and MEMLO needs very detailed oriented planning and
presents hazards.

Basic does move string data as needed, but *only* when the program size
changes as code is added or deleted. Shifts are normally small when "RUN"
replaces "SAVE "D9:ASPI>TBASIC>TEST4.BAS" as immediate mode line number
32768 in the statement table

--
-Ron

Experience is something you don't get until just after you need it.
http://www.atariland.com/members/oldatarian



Quote:> Howdy folks

> I've stumbled onto a problem while trying to debug CD Audio Player (CDAP).

> CDAP is getting so close to the ASPI manager in memory, that TurboBASIC
> overwrites part of the manager.  How do I protect the manager if I can not
> change the location or format of the manager.

> (I just sent Matthias a message to ask him if it is possible to relocate
the
> manager)

> I could stuff the ML code into a BASIC string, but I want to use the
manager
> as is and not create a version that is 'BASIC only'.

> I looked into declaring a string around the manager (from $8000 to $8800),
> but (Turbo)BASIC keeps moving this string in memory.

> Please help.

> CU                            Mathy van Nisselroy


 
 
 

1. My first ML routine for Atari Basic

Not my first, but my first revisited :)

I decided I'm going to dedicate the rest of my life to making Atari Basic
extremely powerful and easy to implement graphics techniques without knowing
much. Of course I'm going to do this by trying to produce relocateable ML
routines that can be called by USR.

My first routine I was thinking would be to do an all in one ML routine that
would take care of relocating the char set for the Atari Basic programmer
and simply return to him the starting address of his modifyable char set.

The ML routine planned is as follows :

MYCSET = USR(ADR(MYCSET$))

MYCSET$ will contain the relocateable ML routine.

Now I'm going to assume the user has already entered into the graphics mode
of choice before calling this routine.  This is what I plan on doing in the
routine :

PLA            --  number of usr variables will be zero and have to clear
stack anyways
STA 212     --  zero the LSB of the returned value from the USR function,
will be zero because character set base will always start on a page
boundary.  Pretty cool optimization huh?   :)

copy the rom cset at 57344 into the address beginning at 256 * (PEEK(106)-4)

update the new CHBASE with poke 756, PEEK(106)-4  and STA 213 right after
for the MSB of the returned value of the usr function.

I am not going to update the value in 106, or should I?  I haven't gotten to
PM graphics just yet but if I need to reserve memory for it as well, then I
should update the value in 106 in this ML routine so if I take the same
action in my PM graphics ML routine using 106 would still be safe?... please
give me your input.

thanks.  I want Atari Basic to be freaking awesome when I'm done with all my
ML routines.

2. Copy NTFS perms to another Server

3. Hey I found a ML move routine...written by ME!

4. Win2k deployment

5. ML Plot routines

6. Sideways spreadsheets with a pkaso/u card

7. The ultimate Player move ML routine

8. Inexpensive print server and DeskJet?

9. ML routine

10. GFA Basic graphics routines

11. BASIC floating point routines in ACTION!

12. Speech routine in GFA-basic - 2 bombs

13. GFA Basic DMA music routines wanted