APPLICATIONSDIVERS ★ SPECTRUM TO AMSTRAD (YOUR COMPUTER) ★

Transplant surgery - a great successSpectrum to Amstrad Part II - completing the transplant
★ 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 ★ 

In this, the last of a two-part article, Richard Sargent finishes explaining how to transfer Basic and data files between these two popular machines.

At the Spectrum end, the Spectrum control program is shown in listing one*. Re-set the Spectrum and enter and RUN listing one. Then LOAD the Basic program you intend to transfer. Find the top of the Basic program by:

PRINT ((PEEK(23628))*256) +PEEK(23627)

If the value is less than 39000, a single pass transfer using listing three at the Amstrad end should work. A value of between 39000 and 50000 will probably still allow a single pass but with listing four in control at the Amstrad end. A value over 50000 indicates that the program should be split in two and transferred in two passes, with the listing four control program on the receiving end.

Take this opportunity to make an ordinary LIST of the program to see if it has long lines, such as a single PRINT statement which writes messages to an entire Spectrum screen. Split them so that none is more than 255 characters long. Also scan the listing for graphics and user-defined graphics -they are also likely to be inside PRINT statements.

Cosmetic patterns

If they are important, they will need to be transferred in the [xxx] format explained, so that they , can be deleted or changed as appropriate in the Amstrad. If they are merely cosmetic patterns there is a quick way to erase them. Changing the “0” byte at 61532 into a “1” will instruct the transfer program to change all Spectrum characters having codes of 0-31 and 128-164 into an upside-down question mark symbol which a word processor at the Amstrad end can remove or change easily. The upside-down question mark is stored at location 61533 and you can POKE in a different symbol there if wish.

The manual adjustment of the Spectrum line length to 255 characters or fewer is not essential, since the transfer program will detect long lines and insert a carriage return after 255 characters. Location 61529 holds the 254 value. It can be changed with a POKE. The significance of line width is explained later.

The Spectrum has many quirks and patching into the LLIST and LPRINT ROM routines is not so straightforward. Thus the transfer control program does not really interact with LLIST and LPRINT. Rather it takes a back seat while LLIST and LPRINT go through their pre-allocated paces. The transfer control program is somewhat quirky, in that it does not re-set itself automatically, so that always before a LLIST you must type RANDOMIZE USR 61440.

Also it must have a special marker placed at the end of the listing so that it knows when the listing has ended and can save the final segment to safety on the tape recorder before the Spectrum operating system clears the screen holding the final segment. This marker is the copyright symbol followed immediately by upper-case X. The last line of the program to be transferred should thus have REM © X typed into it.

Copyright-X

LPRINT: You can use purpose-written programs containing LPRINT to send portions of data, such as the contents of arrays, to the Amstrad. Here are three ways of sending the contents of A$ and B$:

10 RANDOMIZE USR 61440:LPRINT A$;B$“©X”
20 RANDOMIZE USR 61440:LPRINT a$+B$+“©”
30 RANDOMIZE USR 61440:LPRINT A$;:LPRINT B$;“©X”[c/ode]

If an LPRINT is working inside a FOR..NEXT loop, it can quickly output sufficient data to fill a 1B00H VRAM segment. The ©X terminators can be placed anywhere but it is important to note that the rule governing LPRINT transfers is that a RANDOMIZE USR 61440 should precede any LPRINT(s) terminated by a copyright-X. There can be any number of LPRINT statements between the RANDOMIZE USR 61440 and the first occurrence of copyright-X.

At the Amstrad end: For important transfer work, the Protext word processor is ideal for accepting the .ASC files since it can cope with long lines. Long lines cannot go directly into Amstrad Basic, so they are split at the 255 position before they leave the Spectrum.

Abandoned load

The split line is recognised instantly in the word processor. It still does not allow direct loading into Amstrad Basic, since the tail-end part of the split line has no line number and is seen either as a syntax error or as a direct command by Basic which will cause the load to be abandoned. Users without word processors must break long lines manually in the Spectrum listing - and at the Spectrum end - if the transfer is to work.

The machine code loader is shown in listing two. Re-set the Amstrad and load and RUN listing two. It will save the machine code on disc or tape as a file called “ZX.BIB”. The program is self-contained and needs only to be told the load address for the first segment, stored at &8004/8005. It reports to Basic by placing a zero in location &8006, if a tape-loading error occurs, and by placing the length of the segment currently accepted in locations &8007/8008.

Listing three, the Basic control program, is suitable for most medium-sized transfer programs. Tape-only CPC464 users must remove |DISC and |TAPE.IN. Users without the Utopia sideways ROM must remove JNOKEYS. The program from here is self-explanatory, except that the upside-down question mark is produced by function key 9, instructed by line 120.

Intervention

An alternative control program which accepts one segment at a time and saves it to disc/tape before loading another segment is shown in listing four. If you have a disc no human intervention is needed and the program will lay down a neat series of labelled .ASC files on the disc. Re-assembling the .ASC files from disc or tape into a coherent whole is a task which a word processor with a MERGE facility will do well.

Tape-only users may find swapping tapes tiresome and breaking the “read only” tab on the source cassette is recommended, as it will remove the danger of over-writing the Spectrum recording with an Amstrad-generated .ASC file. Amstrad users who have access to a Spectrum can now enjoy many hours of transferring precious data from Spectrum to Amstrad systems. Remember, if the Spectrum can LLIST it or LPRINT it, the Amstrad can grab it.

Anyone interested m the first part of this article can obtain a copy of the January issue by sending £1.50 to the Back Issues Department, 79-80 Petty France, London SW1H 9ED.

Your Computer

★ PUBLISHER: Your Computer
★ YEAR: 1987
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ AUTHOR: Richard Sargent
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» Spectrum  to  Amstrad    (Your  Computer)    LISTING    ENGLISHDATE: 2022-07-14
DL: 112
TYPE: PDF
SiZE: 2721Ko
NOTE: 4 pages/PDFlib v1.6

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

Lien(s):
Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» 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
Page créée en 268 millisecondes et consultée 749 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.