CODING ★ A BIT BOTHER ★

A Bit Bother
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

Why should a program work on an English CPC but not on the same model in Australia? Peter Campbell explains.

Recently I was shown a program, written in Basic, which functioned correctly on CPC6128s in England. but not in Australia, improbable as it sounds! The program had been carefully tested in England and behaved perfectly. However, when asked to do a printout in Australia, the program responded that the printer was not on line, even though it was!

Examination of the program showed that the following test had been used to verify that the printer was on line:

IF INP(&F500)<>30 THEN

If the condition wasn't met. it was assumed that the printer was off line and a message was printed to that effect. The program then aborted the printout.

IN SEARCH OF A SOLUTION

When the author of the program was asked why it wouldn't work, he was mystified and said that the test was a standard one and widely used in English software. Intrigued. I set out to find, first, a solution to the problem and. second, an explanation of why my test worked and his didn't.

I tested the input port using INP(&F500) and found that my Panasonic printer returned *24* and not '30' when ready. When off line it returned '88'. A test of an Epson printer gave the same values. Surely our printers are the same as those in the UK? In a Newsletter, issued in March 1987 by the Southside Amstrad Club (now the Amstrad and PC User Group of Logan). I found a program which used a different test:

IF INP(&F500) AMD 64)<>0 THEN

I tried substituting this test and. sure enough, it worked, but what did it mean? ANDing '24' or '30' with '64' gives a result of '0'. while '88' AND '64' gives a result '64'. Which means that a '0' result means the printer is on line and '64' means it is not. It still doesn't really explain what is going on though.

ELUSIVE EXPLANATION

In searching for why different results were obtained in different countries, when CPC6128s were connected to identical printers. I consulted The Ins and Outs of the Amstrad CPC 464 (Don Thomasson. Melbourne House Publishers. 1984) and found that the test was reading Port B of the parallel peripheral interface (p. 18). Further information was obtained from the firmware manual (Soft 158. Amsoft. 1984. App 12.7).

In Basic, the state of the printer can be determined by reading this input port, using the expression INP(&F500). However, the byte read from this port contains considerably more information than just the state of the printer. Lei's look at what makes up. The eight bits are used as shown in Figure 1 The shaded area of the diagram provides the answer to the mvsteiy. A combination of four Unks is used to tailor the CPC computers for specific markets. If 60Ilz television standard applies, then LK4 is filled. The operating system ROM contains eight possible names (not including 'Arnold'). These are 'Amstrad', 'Orion', 'Schneider'. 'Awa', 'Solavox', 'Saisho', Triumph', and 'Isp'. Just which the computer uses when it signs on depends on what combination of LK1, LK2 and LK3 links are fitted

When tlie CPCs were first marketed in Australia Ihey were handled by AWA-Thorn, who gave some ' consideration lo marketing them under the AWA label, and I have seen a photo of a prototyne ma chine wearing AWA livery on its case. However they eventually settled for Amstrad badging with the name AWA (mis-spelled 'Awa") being shown on the screen when the computer was turned on. The 'Awa' name was retained by Mitsubishi Electric AWA but was changed to 'Amstrad'when the company took over the distribution of Amstrad products in Australia This Involved leaving out LK1 and LK2. which had been fitted to bring up the 'Awa' name.

The information on which links are titled in 'Awa' CPCs can be read from the '24' which was obtained by the test. Here's how. '24' when converted to a binary number is 11000 (or 00011000 if we show all eight bits). The bits arc numbered 0-7 from right to left, Thus:

bit 0 = 0
bit 1 = 0
bit 2 = 0
bit 3 = 1
bit 4 = 1
bit 5 = 0
bit 6 = 0
bit 7 = 0

From Figure 1. we can see thai the bits 1 and 2 being 0. LK1 and LK2 must be fitted. Figure 2 show how the '88' (binary 1011000) can be analysed. Note how bit 6 is now 1. indicating that the printer is not ready. The value '30' (binary 11110) shows that no links are fitted (bits 1-3 all have the value '1'). All of which means that the test used in the English program only works with CPC computers which sign on with the name 'Amstrad'. All others, such as our 'Awa' machines and the German 'Schneider' ones will conclude that the printer is not on line.

So now you know. Programs known to be affected include 'Master Disc'and some programs from SD Microsystems. Naturally. Cue Three Software (who asked me to look into the matter) are making arrangements to have the problem rectified. If you have experienced this problem and the program you have is unprotected Basic, simply substituting the corrected test will afford a cure. Otherwise you may need to ask your dealer for an update.

This article was reproduced from May 1990 Newsletter oj the Southern Tasmanlan Amsirad Club and surely proves the advantages of belonging to a club with knowlegablc members!

Peter Campbell, TAU

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Coding Src's » Fast Text Routines for Mode 2 Screens (Jason Brooks)
» Coding Src's » Hardware keyscan
» Coding Src's » David Wild PD desktop RSX library
» Coding » Menu - Divers
» Coding Src's » Execution d'une instruction BASIC en assembleur
» Coding Src's » YaGol4CPC
Je participe au site:

» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 442 millisecondes et consultée 1584 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.