APPLICATIONSDIVERS ★ SAVING SPACE ★

Remove Double Line Spacing In Print (Computing Today)Applications Divers
★ 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 ★ 

Remove unwanted line feeds from your listings with this short routine for the Amstrad CPC464

In the CPC 464, a stream of ASCII characters may be directed freely to either the VDU or to a printer. In order to make the format acceptable to the VDU, each line is terminated with both the CR code (value 13) to return the print position to the head of the current line, and the LF code (value 10) to advance to the next line. Most printers will interpret either of these codes as a combined CR/LF operation; with the consequence that where both are sent to the printer a double line spacing will
result.

Whilst the best solution must be an adjustment (e.g. a dip switch) at the printer which will remove the response to either one of the codes, the AMSTRAD published firmware contains a mechanism which may be employed to achieve the same effect. The disadvantage is that the software mechanism is reset by a general machine reset, and therefore may not be use able with commercial software.

The essential routine in the printer driver is MC WAIT PRINTER, whose entry is to be found in the indirections block at BDF1. The 3-byte block at this address will be found to contain the jump instruction JP 07F8. It is therefore possible to replace this jump address by the address of a suitable machine code routine whose function is to replace the CR code by an innocuous value (e.g. zero) and so eliminate the redundant line.

The 16-byte routine is poked by the program into locations from AB00. Lines 20 - 50 plant a jump to AB00 into the indirections block. The routine itself first preserves register A (which holds the character to be printed) by pushing the register pair A, F onto the stack. The exclusive OR of the character with value 13 can only be zero if A itself contains the value 13, ie the CR control code.

If the result is non-zero (any other character) the jump to AB0C results in the registers A, F being restored from the stack. Otherwise, A and F are restored and A is replaced by zero. In either case control reaches AB0D, where the original jump from the indirection block is obeyed to print the character.

The final line (220) sets the top of BASIC memory to the address immediately below the head of the routine. (AAFF)

In use, the program is loaded and run before any use is made of the system, and will remain available unless a general machine reset is performed. It will not be destroyed by a NEW command. In order to make the routine generally relocatable, it is only necessary to replace the jumps in lines 90 -110 and 150 -170 by the equivalent relative jumps, and modify the indirection replacement.

Computing Today

★ PUBLISHER: Computing Today
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ AUTHOR: J.G. Gibbs
 



★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» Remove  Double  Line  Spacing  In  Print    (Computing  Today)    ENGLISH    LISTINGDATE: 2022-07-06
DL: 191
TYPE: PDF
SiZE: 1026Ko
NOTE: 1 page/PDFlib v1.6

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

Lien(s):
» Applications » New Letter Font for AMSTRAD CPC
» Applications » Letter Litter (Computing with the Amstrad)
» Applications » Speedy Letters (CPC Amstrad International)
» Applications » Fancy Letters (Popular Computing Weekly)
» Applications » RSX Bigletter (Schneider Aktiv)
» Applications » Kangaroo's Letter Creator v3
Je participe au site:
» Pour ce titre nous ne disposons de fichier executable sur CPC (Dump, Saisie du listing) , alors si vous avez ça dans vos cartons ou vous désirez usé vos petit doigts boudinés sur votre clavier faites le nous savoir.
» Vous avez des infos personnel ?
» 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.732-desktop/c
Page créée en 767 millisecondes et consultée 707 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.