MESSAGE MOVER
by Martin Evans
from Your Spectrum 10 (Dec'84/Jan'85)

Have you ever wanted to put a message or instructions for a game
as scrolling text on the 23rd line of the screen display - just like
they do in the professional commercial packages? Well, here's
your chance. This machine code program can be used to display a
string of text which is constantly scrolled so that the words go off
one side of the screen as others enter from the opposite side.
	I've produced an assembly listing of the routine (listed from the
GENS3 HiSoft assembler), but there's also a Basic program which
will do the trick if you've not got an assembler at hand. The Basic
listing of the routine should be typed in directly as it stands; you'll
notice that a number is included at the end of each line of data as a
checksum and, if a mistake is made in your typing, the line number
containing the mistake will be displayed on-screen.
	Once you've typed the program in without error, it would be
wise to save it using SAVE "SCROLL" CODE 60000,95. It might
also be a good idea to save the Basic as well, so that you can make
the suggested changes that follow without corrupting your copy.
	The Basic can now be erased using the command NEW - the
machine code will, of course, still be present as it's positioned
above RAMTOP. To test the routine, type in the second Basic
program given and RUN it - you should now get the contents of z$
scrolling, pixel by pixel, across the 23rd line of the screen display.
To return to Basic, simply press any key.
	To incorporate this routine in one of your own programs, you
should use the second program given as a subroutine, define your
particular message as z$ and then GO SUB to the subroutine. The
machine code is completely re-locatable, but it must not be loaded
to the same address as the data for the message - otherwise you'll
crash the computer.
	As the routine stands the string will be scrolled round and round
until a key is pressed. However, to alter the routine so that the
message is only scrolled once, the value '40' in line 70 of the first
program must be changed to '200'; alternatively, you could load
the machine code, type POKE 60065,200 and re-SAVE the code
as shown above.
	16K Spectrum owners will be pleased to hear that they're not left
out - for once! Simply add these two lines to the second Basic
program:

15 RANDOMIZE (NEW ADDRESS)
16 POKE 60001,PEEK 23670: POKE 60002,PEEK 23671

You'll also have to alter the value '59399' in lines 30 and 50 to a
new value 'new address - 1'.
	As a last note, when POKEing z$ into memory, it's important
that the last address is POKEd with zero to tell the routine where
the end of the message is; look at line 50 of the second Basic
program.


PROGRAM 1
This program allows you to enter the machine code scrolling
routine in Basic. Once you've made sure it's error-free, SAVE
it to tape using the instructions given in the text.

Lines 10-90
Contain the data for the machine code routine. The last
number on each line of data is the value of the checksum -
so you'll know whether a mistake has been made as soon as
you RUN the program.

Lines 95-180
Lower RAMTOP, clear the checksum (b), and READ and
POKE the data making sure the checksum is correct for
each line.


PROGRAM 2
This program allows you to test the routine, providing a message
in z$ which will be scrolled on the 23rd line of the screen display
once the program is RUN. This program can also be used as a
subroutine in your own programming efforts. 16K owners should
read the text for the instructions on how to manipulate this program
for their machines.

Lines 5-10
Place the message (given in quotes) in the array z$.

Lines 20-40
POKE the message in z$ into locations 59399 onwards in memory.

Lines 50-60
Poke the value '0' at the end of the message in z$ and call
the routine.

Line 70
Prints the code of the key pressed.


--
Another Fine Product transcribed by:
Jim Grimwood (jimg@globalnet.co.uk), Weardale, England
--
