PROGRAM PITSTOP

Your Sinclair, June 1992



CRAIG BROADBENT has recently discovered a peculiar penchant for

Macaroni Cheese; luckily this hasn't stopped him from typing in

those cheesy listings.





First of all I'd like to say how impressed I was by the amount of mail

I got this month - well done to all involved. And keep it up! This

month's lucky winner is Paul Wardle for his lovely print routines. As

for the rest of you, don't despair - there was so much good stuff sent

in that some of it may well see the glossy pages of YS in a future

issue. I actually picked out three programs for this month's pitstop

but there was absolutely no way they'd fit in. So you'd better tune in

next month hadn't you?





= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 





42 AND 64

by Paul Wardle



What's so special about 42 And 64 then? Well, as any fule kno, 42 is

the answer to Life, the Universe and Everything. 64 is a somewhat

inferior Speccy rival whose manufacturers were eventually forced to

start making 16-bit computers in order to make a living. More to the

point though, 42 And 64 are two lovely, smashing, great etc. print

routines that enable you to print text in 42 columns, 64 columns or

Tasword.



The machine code listing is the one that does all the work. For 42 it

takes a string, chops two columns out of each character and prints the

remainder whilst attempting to reconfigure the attributes as it does

so. (Although, obviously, it can't change the position of the

attribute grid.) Paul also refers me back to a similar routine in

YS.29 which was written by the then presenter of Pitstop - David

McCandless. Paul goes on to say that 42 is dead useful for tables and

stuff because it doesn't do proportional type and the caps are printed

the same width as lower case letters.



64 works in a slightly different way, it has a whole new 4-pixel wide

character set contained within the Hex. Also, both routines can be

printed on the bottom two lines without any of that funny #1 business.





How it works



It's so simple! All you have to do is type in LET Z$="a sentence" and

then RANDOMIZE USR 60000 for both routines. [The 42-char version on

PR_42_64.TAP starts at 63234, as I happened to have one already typed

up which had been altered to work from that address. JimG] If you're

really fussy you can put co-ordinates in as well, in the form:

LET Z$ = CHR$ 22 + [y co-ord] + [x co-ord] + "a sentence"

Alternatively, you could set up a function to do the donkey work of

fitting the co-ordinates in; just take a look at the demo listing for

more details.



For 42, the screen is 42 wide by 24 deep; and for 64 it's 64 across by

24 down. You can also insert a CHR$ 13 to do the same as an ENTER. And

remember, you don't affect the AT position by clearing the screen.





Techy bits



Paul has also sent in a run-down of the code bits. 42 is split into

four parts ...

63234 - 63326: Main handling routine, checks for control codes and

prints the string on the screen.

63327 - 63545: This routine forms the new 6-bit wide characters and

alters the colours to match the text. The y,x co-ordinates and eight

bytes of workspace are located at the end of this chunk.

63546 - 63641: The data showing which columns to chop out of each

character.

63642 - 63689: The completely redefined characters %, &, 0, T, Y and

(c). These just look daft with columns cut out.



64 is split into three similar parts:

60000 - 60092: Handling routine, same as the one for 42.

60093 - 60229: Printing routine accesses the new 4-bit wide character

set and alters the colours. Contains the y,x co-ordinates at the end.

60230 - 60613: The data containing the new character set. To save

memory, each byte contains two characters. Characters can be retrieved

using the formula Address = Base + 8 * (Code-32)/2. The remainder

following the division gives the position of the character within the

single byte, found by examining the carry flag.





= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 





EGGS



Well, I can see the page number looming in front of me. It's time to

pack up my tools and lock up the Pitstop for another month. But what

an apple pie of a column we've had this month, eh? What's more, next

month's is going to be just as full. And how would you like to see 

the same amount the month after that? You would? Good, just send in

those programs and I'll see what I can do. The name's CB and the address

is Program Pitstop, Your Sinclair, 30 Monmouth Street, Bath, Avon BA1 2BW.



