APPLICATIONSDIVERS ★ SIDE WRITER (COMPUTING WITH THE AMSTRAD) ★

Side Writer (Computing with the Amstrad)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 ★ 

ROLAND WADDILOVE shows how to manipulate character definitions so that you can display vertical text

THE Amstrads superb high resolution graphics are perfect for displaying graphs, charts and diagrams. By making use of its powerful graphics commands data can be represented in an easily digestible form.

It is often necessary when displaying data in this way to write vertically as well as horizontally. The axes of graphs and the bars of a histogram are always labelled vertically, and it is often useful with diagrams as well.

One way of printing a string vertically would be to print each character below the previous one. Program I shows how this can be done.
This isn't true vertical writing though, as the characters are the wrong way round. Tilt your head to one side and try to read the writing and you'll see what I mean.

It would be nice if there was a command which rotated the characters and printed them vertically for us. Side Writer is a short routine which adds two new commands to Amstrad Basic using RSXs.

One command. |PRINT.UP, rotates the characters of a given string 90 degrees in an anticlockwise direction and prints vertically upwards. The other, |PRINT.DOWN, rotates the characters 90 degrees clockwise and prints them in the opposite direction.

Program II is a short Basic routine to poke the machine code above HIMEM, and Program III is an assembler listing. If you have an assembler you can place the code at a different location if there is a clash with any of your other RSXs. You'll need to CALL &A000 to enable the RSXs if you are using an assembler.

Users of the latest Amstrads have an advantage over the CPC464 when it comes to using RSXs. To print upwards on either machine use:

a$="Message..."
|PRINT.UP,@A$

and the text will be printed up starting at the current print position. It's just the same when printing down, except use |PRINT.DOWN instead of |PRINT.UP.

Similarly, owners of the newer Amstrads can simply enter:

|PRINT.UP,"Message...."

to get the same effect. This is much easier and closer to the ordinary Basic PRINT command.

The routine starts at &A031 and first picks up the address of the string descriptor from the parameter block pointed to by the IX register. The length of the string and address it is stored at is then collected.

The main loop starts at &A03D and is labelled another. Each character in the string is loaded into the A register and the address at which the data making up the character is stored is found by calling the firmware at &BBA5. This may be in the lower ROM, so this is enabled.

A check is made whether the character is to be printed up or down and the appropriate subroutine is called. The two subroutines up and down rotate the character data left or right. They are both very similar, so if you can follow one you'll be able to cope with the other.

If you look at up you'll see that there are two loops. The outer loop runs from byte 0 to byte 8 of the character, loading the data into the A register. The address of the character is in DE, and HL is loaded with the start of the 8 byte workspace reserved for the routine. This is labelled chr255.

The inner loop runs from byte 0 to byte 7 of the workspace. The character data in the A register is rotated left each time so that bit 7 ends up in the Carry flag. Then the Carry is rotated right into the corresponding byte of the workspace at chr255.

The result of all these rotates is that the bit pattern of the workspace ends up as an exact copy of the character data, except that it has been rotated through 90 degrees.

The rest of the main loop simply defines the workspace as character 255 and prints it on the screen. The print position is then updated.

As you can see, it's quite easy to manipulate character definitions. The two commands should spruce up your graphs quite nicely.

Just for fun, can you alter the routine so that it mirrors text and graphics characters?

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1985
★ AUTHOR: Roland Waddilove
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» Side  Writer    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-18
DL: 178
TYPE: ZIP
SiZE: 4Ko
NOTE: 40 Cyls
.HFE: Χ

» Side  Writer    (Computing  with  the  Amstrad)    ENGLISH    LISTINGDATE: 2021-02-02
DL: 172
TYPE: PDF
SiZE: 79Ko
NOTE: 1 page/PDFlib v1.6

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

Lien(s):
» Applications » Crazy - Writer
» Applications » Extented Disc Image Writer
» Applications » Tabwriter (CPC Amstrad International)
» Applications » WorkWriter Jr.
» Applications » Star Writer
» Applications » Ghouls Writer
Je participe au site:
» 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.7-desktop/c
Page créée en 259 millisecondes et consultée 776 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.