SCROL Subroutines - Copyright 1993 by Microdex Corporation
----------------------------------------------------------
Design: Chris Fara. For use with Mod-III and Mod-4 BASIC,
these self-installing, self protecting machine language
routines enable scrolling of any screen lines up and down.

Files: SCROL3/CMD    for Model III TRSDOS 1.3 and LDOS 5.x
====== SCROL4/CMD    for Model 4   TRS/LS-DOS 6.2 or higher

Usage: From DOS READY enter, depending on machine
====== Model III      SCROL3
       Model 4        SCROL4

The routine installs itself in high memory and protects
itself from DOS and BASIC by lowering the HIGH$ address.
After installation a message appears similar to this:

       Call address = 64000 decimal = FA00 hex

The actual numbers will vary from system to system. Make a
note of these numbers and enter BASIC (no need to protect
memory). In BASIC use these numbers to define the address of
the routine like this:

Model III:  DEF USR = 64000-65536   or   DEF USR = &HFA00
Model 4:         Z% = 64000-65536   or        Z% = &HFA00

Now suppose you want to scroll a middle portion of the
screen, say 6 rows, from row 5 to 10 inclusive, in the down
direction. Define an integer variable like this:

       L% = 5                   'starting row
       H% = 10                  'ending row
       HL% = L% + 256*H%

Then call the subroutine like this:

       Model III:    Z% = USR (HL%)
       Model 4:      CALL Z% (HL%)

To scroll the same part of the screen in the opposite
direction, simply reverse the L% and H% variables:

       HL% = H% + 256*L%

So the general idea is that when the "starting row" is
smaller than the "ending row" then the specified rows scroll
down, and the other way around.

After the scroll cursor stops at the beginning of the blank
top line of the scrolled area (if scrolling down) or of the
blank bottom line of the scrolled area (when scrolling up).
Of course no other "scroll protection" is needed, because
scrolling is completely controlled by the program.

Questions? Write Microdex, 1212 N.Sawtelle, Tucson AZ 85716

