[comp.sys.apple2] Turning on 80 columns from ASSEM kills BASIC, why?

rsherman@mthvax.cs.miami.edu (Roby Sherman) (02/14/91)

Hello, all...



    I've been trying several methods to turn on the 80 column hardware from
    assembly (some of my own design and from other programs I have) but
    all of these routines seem to clobber BASIC in such a way that ProDOS
    calls will no longer work from the BASIC interpeter. (IE: CAT, RUN, etc)

    Has this happened to anyone? My program is pure assembly, so I'm not
    GREATLY concerned with BASIC getting the axe, but I am concerned that I
    might be messing up other parts of memory where MY code resides.


		   thanks in advance,

				Roby


-- 
Roby Sherman    |  rsherman@mthvax.cs.miami.edu
//Interealm\\   |--------------------------------------------------------------
P.O. Box 63-04  | "Pulver the river and Frotz the woods..." -- Beyond Zork 
Miami, Fl. 33163|  

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (02/14/91)

rsherman@mthvax.cs.miami.edu (Roby Sherman) writes:

>    I've been trying several methods to turn on the 80 column hardware from
>    assembly (some of my own design and from other programs I have) but
>    all of these routines seem to clobber BASIC in such a way that ProDOS
>    calls will no longer work from the BASIC interpeter. (IE: CAT, RUN, etc)

>    Has this happened to anyone? My program is pure assembly, so I'm not
>    GREATLY concerned with BASIC getting the axe, but I am concerned that I
>    might be messing up other parts of memory where MY code resides.

This is not the problem. What's happening is that BASIC.SYSTEM grabs prodos
commands from the keyboard by redirecting things with the same mechanism
used by the 80 column card. The problem here is that BASIC.SYSTEM does not
provide a standard mechanism for changing its own hooks like DOS 3.3 did.

The basic point here is that with BASIC.SYSTEM running you should:
	save the contents of $36 and $37
	jsr $c300
	take what is now in $36 and $37 and put them in $be30 and $be31
	restore the original values of $36 and $37
This method is a bit convoluted but it assumes nothing about the 80 column
card and will work with non-apple cards.

Todd Whitesel
toddpw @ tybalt.caltech.edu