★ APPLICATIONS ★ DIVERS ★ PRINTER CHARACTER MODIFIER (PRACTICAL COMPµTING) ★![]() |
| Printer character modifier (Practical Compµting) | Applications Divers |
ONE common problem when using a printer with the Amstrad is that both a Linefeed and Carriage Return are sent to the printer, which causes a double Linefeed to all printed output. D J Ellis suggests that one way to solve the problem is to cut wire 14 on the printer lead — if you can find the correct wire. He also suggests a simpler method, which is a lot more versatile. You divert the output from the CPC-464 to the printer, via a machine-code program which checks for the value of 13 — the Carriage Return — or any other characters that you wish to change. It then sends the modified values to the printer in the normal way. The accumulator holds the value to be sent to the printer and the routine is called via the jumpblock at &BD2B. The listing shown redirects this jump to the machine-code routine, which is compiled by the Basic program. First, the program asks you where you want the machine-code program to reside in memory. No limitations are imposed here as it is possible that the screen memory may be located lower in memory, and you may also have other machine-code programs in memory. The machine-code program will use up a minimum of 15 bytes if no changes are made, 21 bytes if the Linefeed is suppressed, and an additional six bytes for each character that you modify. If you are not sure where to put it, then try &9000 (36864), which is as good a place as any. Prefix hexadecimal numbers with & if you use them. The Top of Basic pointer will be set to just below the address that you choose — line 50030. The next five lines Poke this address and some data to the machine-code program; this part is where the redirection takes place. If you wish to suppress the Linefeed, press the Enter key when prompted by lines 50090 and 50100. Press any other key if you want the double Linefeed to operate. You will then be asked if you wish to change any of the characters. Often daisywheel characters do not match up with those on the CPC-464. For example, the £ sign on the CPC-464 is ASCII 163, but the CPC-464 can only send numbers between 0 and 127 to the printer as it ignores the eighth bit. So 128 is taken off the value of 163, and the value sent for £ is 35. On some wheels 35 is the £ sign, but on others it is the # sign. If the £ sign is not on the wheel at all you can use the $ character as a last resort; this is ASCII 36. When prompted by line 50130 press the Enter key to change characters. In reply to line 52010, enter 163 for the character to change, and then 36 in reply to line 52030 for the character to change to. To make further changes to other characters press the Enter key and repeat this process. Otherwise press any other key and the program will end after tagging the original call to ROM on to the end of the machine-code program. The machine-code program will be Called in line 50180, and any characters sent to the printer will be checked to see if they need modifying. In the case of the Linefeed this is changed to a null character, so nothing is printed. If you have a dot-matrix printer you should also find this program useful. You can also change the printing codes below ASCII 32 if you like, which could prove interesting. Once the program has been run you can New it as the Basic program then takes no further part. The lines are numbered so that you can Chain Merge the program on to the end of a program that you have in memory, and then use it and delete it before listing or using the program. Keyboard aid If you are a touch-typist, you will have noticed that the Amstrad CPC-464 has an unconventional arrangement for the colon and semicolon, which probably slows up your typing. REF Street provides an easy solution to the problem. Add the following lines to your program 10 KEY DEF 29,1,1,58This addition will move the colon to its conventional position in place of the asterisk; move the semicolon to its normal position in place of the colon and move the asterisk to where the semicolon used to be. |
| ![]() |
|