PROGRAM PITSTOP
Your Sinclair, October 1992

Somewhere in deepest Chippenham a car alarm is bleeping. CRAIG
BROADBENT tries to ignore it by studying these listings.


Hello and welcome once again to the programming section - that cuddly
couple of pages where we encourage you to delve beneath the shallow
realms of console-land (ie. playing games) and find out what a real
computer can do. (Long pause.) I'm sorry - I just can't concentrate -
there's a really irritating car alarm going off up the road and it
won't shut up, so that'll have to be it for the introduction. How
about I show you some of this month's programs instead, eh?


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


CONVERTER
by Owen Stott

[The Decimal to Binary & Hex routines from 400-570 could be simplified]
[& improved. Eg. there is unnecessary jumping around with GO TOs; plus]
[Dec-Hex only prints the last two digits, so decimals >255 don't print]
[as hex correctly; plus leading 0s could be omitted - but I've just   ]
[left it as it was printed in the magazine.                       JimG]

Numerical bases, eh? They're a pesky bunch and no mistake. You've got
denary, base ten, your average everyday numbers; you've got hexadecimal,
base sixteen, a mixture of numbers and characters; and you've got the
granddaddy of them all, binary, base two, which is, erm, a collection
of ones and zeroes. It's the simplest number system there is, you know
(just a mite tricky to understand, that's all). Anyway, that's where
this handy proglet comes in. Owen's routines convert numbers from any
of the three bases into, well, any other of the three bases. [Not so -
they only convert between decimal and the other two. JimG] Now you too
can make sense of all those hex listings in Pitstop, or find out the
binary for forty-seven, or something.


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


CHAR PEEK
by Owen Stott

That pesky car alarm is still wailing. Let's hope somebody steals the
car soon, eh? To continue the binary theme, here's Owen again with a
small but perfectly formed routine that allows you to see exactly how
the character set is made up in memory. Just type in a letter or
number and the prog will display that character's ASCII code, binary
representation and block pattern. The character set itself is held at
location 15360 (PEEK 23606 + 256*PEEK 23607) and with a bit of cunning
maths, Owen's routine reads out the pattern of your character and
whaps it onto screen, using graphic squares instead of pixels so you
can see [and] appreciate its clinically elegant design (or something).
Very handy if you're into designing fonts, and a fair bit of fun if
you're not.


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


SHMOO!

The end of the column, and would you believe, the wretched car alarm
has stopped! Well, I'll certainly sleep easier in my bed tonight. So
will half of Chippenham, I should think! Send in your programs to CB,
Your Sinclair, 30 Monmouth Street, Bath, Avon BA1 2BW; and mark
PITSTOP on the envelope (or jiffy) to make life easier.

