|★ APPLICATIONS ★ DIVERS ★ PRINTING MODES|POPULAR COMPUTING WEEKLY) ★|
|PRINTING MODES||PRINTING MODES: PART 2|
There's a Firmware Indirection in the Ram of the 464, which intercepts characters on their way to the printer. This allows you to use a machine code routine to take a look at the characters, as they speed by, and respond to particular ones by having them trigger another routine which can send new Escape sequences to the printer. This means, in effect, that you can cue your text to change the printing modes: to use emphasised print, instead of normal, for example.
I have written two short programs (one printed this week, the other next week), which make use of this trick. The first is designed for use when you are Listing a Basic program. It recognises a Rem statement in a line and prints anything that comes after the Rem in emphasised type. This means that your comments in a program show up clearly and help to make the program easily understandable. You can see how effective it can be if you look at the Basic program below, which was reproduced with the help of this utility. Program two (next week) allows you to cue for double-width printing (useful for headings), or lets you underline words, or sections of text. It can be used with the Easi-Amsword word-processing program, which is bundled with most 464s, as well as in other situations where you would want to output text to a printer.
The actual routines have to be in machine code, but I have put them into short Basic progams, which will enter the code into the computer's memory for you. Once you have done this, you can forget the Basic programs and Save each piece of machine code, by itself, for future use, with Save 'Listmark',B,(your address), 150 (this week) and Save "Printer",B,(your address), 100.
One of the attractions of the routines is that you can Load them anywhere (well, anywhere sensible) in RAM. You put them in action - plug them in, as it were -by Calling the address you Loaded them to. Each routine checks to find the address at which it is located and then sets itself up accordingly. It is what is known as fully re-locatable. You 'unplug' the routines by Calling the address you Loaded to + 2.
My printer uses Epson compatible codes and the ESC sequences have been chosen to fit it. Your printer may use different codes and you will want to check them in your instruction book. You may also want different kinds of type emphasis, which would require different codes. In this program, I have allowed space for five different codes: this would let you use a combination of sequences -italic and underline, or condensed, or whatever. The only thing to remember is that you must have exactly five codes, or the program will crash. You must pad out with "0"s (as I have done), if you use less than five (lines 900-920).
I ought to point out a limitation in using the Rem program. To save space, 1 have not made the program check for context, when it finds a Rem. This means that if you use a word like "Remark" in your program - or even "FIREMAN" - funny things will happen! However, remember; "Remark" and "Fireman" (and even "remember") are perfectly OK.
Next week, the printer and program.
CPCrulez[Content Management System] v8.7-desktop/cache
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.