PROGRAM PITSTOP
Your Sinclair, May 1989

It's time once more to look at your programming prowess, so here's
your host with the most, David "Fab Wack Macca" McCandless.

I said a few months ago that Pitstop was going to be party to a few
changes. Well, those changes are coming soon to a magazine near you.
For a start I'll be letting my responsibilities slip. Yep, I'll be
hanging up my cliche's and packing my annoying sub-heads to depart for
pastures new (and hexadecimal free). And Jon-boy Davies will be taking
over with his unique brand of enthusiasm, (he'll probably do a better
job than me). But you'll have to wait for a couple of sleepless months
for the change over - and the first person who says they're looking
forward to it gets severely beaten. (I'm looking forward to it. Ed).
Ah, eerrrh, well, I meant more of a thunderous round of well- earned
applause.

Anyway this month's offerings are pretty varied. First is the premiere
part of The Hacker, a phenomenally useful disassembler by Gary
Shepardson, serialised over two issues for your delight. Then, Chris
Pile makes a welcome return to these pages with his screen quadrant
magnifier - read on for more details of that. And there's a special
from Damian Stones too!

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

THE HACKER
by Gary Shepardson

[The Quadrant Magnifier listing was printed here instead.]
[The first part of The Hacker listing was never printed. ]
[(see June 1989 issue, page 8)                       JimG]

Now this has to be the single most useful program I've ever printed
here in Pitstop. I do not jest. You may have noticed how I always brag
about the size of my disassembler in the POKE pages (they don't call
me David "if it moves POKE it" McCandless for nothing y'know). Well
now here's a tiny disassembler, brain-child of one Gary Shepardson.
It's so versatile and brilliant that I decided to split it up over two
issues just to increase the suspense (and make it look smaller).

Cunning
The most cunning feature of this gembo is that it resides in the
top-half of the screen. This means you can load the program you want
to dissect and not have it over-written by the disassembler - a common
problem among us master hackers.

Useful!
There are a variety of uses for Gary's program. Best is the street
credibility value. Invite your friends around, have the disassembler
'accidentally' running on your computer, and they'll be so amazed
they'll build a religion around you! Also, this program will allow you
to nose about other people's programs, and let you search for
mysterious things like POKEs and cheat modes. And if you're
UNBELIEVABLY clever you'll be able to install it into a Multiface.

Brilliant
If you simply can't wait until next month, or just can't be bothered
to type in each instalment of the 1024 bytes then send a cheque or
#2.50 postal order to Gary Shepardson, 4 Epping Close, Thornaby,
Cleveland, TS17 0DY. And old Gazzer will do the rest.

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

ZOOOOOM!
by Chris Pile

[A Block Line Delete listing by J.M. Clough was printed here.  JimG]

Usefulness is simply emanating from these pages this month. I can
barely believe it myself. After the superlativeness of the last
offering we now have Chris Pile and his excellent (and short) Quadrant
Magnifier which'll allow you to zoom in on a specific quarter of the
screen. Wowsers.

Simple Pimple
To get magnifying just type in the self-sufficient, user-friendly
Basic program. Once RUN, this will assemble the code in memory (at
address 63400 incidentally) and SAVE it for you. Cor; some people
don't know how easy they have it. Afterwards NEW the computer to clear
the BASIC away. The code will remain intact.

Zooooom!
First thing to do is specify which quadrant is to be magnified. You do
this by POKEing.a value into address 63401 (0 - Top left, 1 - Top
right, 2 - Bottom left, and 3 - Bottom right). So if you wanted to
magnify the bottom left you'd POKE 63401,2 and so on. Follow up the
POKE with RANDOMIZE USR 63400. A magnified version of that part of the
screen will now fill the entire screen. Repeating this process
produces a sly little zoom effect.

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

TECHNO-BILGE
448 EXTRA COMMANDS FOR THE PRICE OF ONE

Warning: You are now entering the technical zone.
All those with brains smaller than Southampton
should not read on. Insanity, lysteria and other
related disorders may result. You have been warned.


If you are a programmer, can handle machine code and are pretty damn
observant, you may have noticed one or two yawning gaps in the Z80
assembly language instruction lists. Well, in fact they aren't just
gaping hexadecimal abysses but actually hidden secret instructions.
Spook!

The story goes that when Zilog (who put the 'Z' in Z80) came to polish
off its new wonder chip, it found that some cunning instructions
didn't actually work (a bit of a bummer considering that the chip was
practically finished). So rather than redesigning the entire chip (and
spending lots of money) it opted to just ignore the culprit commands,
since they weren't that essential.

The discovery of these concealed commands is no great revelation
nowadays, but you know me, I'm always slow to pick up on good ideas.
I, of course, in my all-encompassing wisdom, knew about them and
pretended to understand them. But it was not until Damian Stones
approached me with an enlightening article that I realised their full
potential. So what else could I do but tell you lot?

Mysterious
These mysterious mnemonics inhabit the DD-CB and FD-CB areas of the
tables (that is they must always be prefixed with DDCB or FDCB). These
instructions do the same as normal ones but load the result of the
operation into the index register specified. For example, DD-CB-00-01
loads C with the contents of a RLC (IX+00) i.e. LD C,RLC(IX+00). If
you know Z80 this is an illogical combination but it works.


Tables
Hopefully these tables will explain what I mean more eloquently than I
have already done:

INSTRUCTION	CODE	INSTRUCTION	CODE
-----------	----	-----------	----
RLC		00	RES 0		80
RRC		08	RES 1		88
RL		10	RES 2		90
RR		18	RES 3		98
SLA		20	RES 4		A0
SRA		28	RES 5		A8
SLL		30	RES 6		B0
SRL		38	RES 7		B8
BIT 0		40	SET 0		C0
[A line appears to have been missed out here.  JimG]
BIT 2		50	SET 2		D0
BIT 3		58	SET 3		D8
BIT 4		60	SET 4		E0
BIT 5		68	SET 5		E8
BIT 6		70	SET 6		F0
BIT 7		78	SET 7		F8

Form the command with the following structure: DD-CB-nn-XX where 'nn'
is a displacement for the indexed command (i.e. IX+nn) and 'XX' is
formed as shown opposite.

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

Toodle Pip
Anyway, howsabout sending me some of your inspiring "not bad" little
programs yer selves? Male or female, Basic or Hex, blonde or brunette
- I don't discriminate. Just document it as well as you can, jam it
onto a tape and bung it to me (via the Royal Mail grapevine) to David
McCandless, Program Pitstop, Your Sinclair, 14 Rathbone Place, London,
W1P 1DE.

