APPLICATIONSDISQUE ★ RSX - RANDOM DISC ACCESS|POPULAR COMPUTING WEEKLY) ★

RANDOM DISC ACCESSRANDOM DISC ACCESS: Part 2
★ 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 ★ 

The method Amstrad opted for to interface disc commands to Basic has the tremendous advantage of making nearly all software written for cassette directly compatible with disc drives. However, it has the disadvantage of supporting only serial files, that is files can be opened, read in record one, followed by two, followed by three and so on. There is no facility for 'Random Access'files, (although these are supported in the CP/M environment). In a random access file any record can be read at random. For example, record 55 can be read directly, without Basic having to read in and skip over records 1 to 54 as with a serial file.

The machine code program presented here over the next two weeks gives the Basic programmer the facility to use simulated random access Tiles. I say simulated because the program itself uses Amsdos serial files as there is no file mapping available in Amsdos, but to the Basic user the files appear to be randomly accessible. Another advantage of using this filing system is that as files do not have to be opened and closed there is no limit to how many files a Basic program can access 'at once'. Amsdos normally supports only one input and one output file simultaneously.

The user interface is via three new RSX commands, these are DREAD, DWRITE and CREATE. Each will be described in detail, but you will find it easier to understand their use by using and studying the demonstration program included. To use the new commands you will first of all need to type in and run the Basic loader program, this will inform you if you have made any errors in the data statements, in which case you should recheck your listing.

Before you can read or write to a file it must first be created, using the CREATE command. This is followed by a filename string and the maximum size of the file. Note that once created you cannot enlarge a file, so always over estimate the number of bytes required. The usual format of RSX's is required, that is a '|' (shift @) character preceding the command name, and a comma directly after it. This should be familiar to disc users as it is the same as is used by the ERA, REN, DIR, etc. commands. A valid sequence to create a file called "PCW01.DAT", which can hold up to 2000 characters would be:

f$ = "PCW01.DAT" |CREATE, @f$,2000

A random file must have a fixed record length, (the number of characters. m each record). In the demo program this is 40 characters. When writing a string to a file you must pad out the length to the full record length with spaces, using for example the function FNp$ as in the demo program. Details of DWRITE and DREAD next week.

PopularComputingWeekly860116

★ PUBLISHER: POPULAR COMPUTING WEEKLY
★ YEAR: 1986
★ AUTHOR: Brian Cadge

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» RSX-Random  Disc  Access    (Popular  Computing  Weekly)    ENGLISH    LISTINGDATE: 2017-05-02
DL: 16 fois
TYPE: PDF
SIZE: 352Ko
NOTE: Uploaded by CPCLOV ; 4 pages/PDFlib v1.6

Je participe au site:
» Newfile(s) upload/Envoye de fichier(s)
★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Coding Src's » Graphic - C-Dragon (Amstrad Computer User)
» Coding Src's » Config - Systemidentifikator (CPC Amstrad International)
» Coding Src's » Graphic - 3D - Laufer (CPC Amstrad International)
» Coding Src's » Rocky 2 (Amstrad Action)
» Coding Src's » Musique Rendez-vous
» Coding Src's » Big Scroll (Computing With the Amstrad)

QUE DIT LA LOI FRANÇAISE:

L'alinéa 8 de l'article L122-5 du Code de la propriété intellectuelle explique que « Lorsque l'œuvre a été divulguée, l'auteur ne peut interdire la reproduction d'une œuvre et sa représentation effectuées à des fins de conservation ou destinées à préserver les conditions de sa consultation à des fins de recherche ou détudes privées par des particuliers, dans les locaux de l'établissement et sur des terminaux dédiés par des bibliothèques accessibles au public, par des musées ou par des services d'archives, sous réserve que ceux-ci ne recherchent aucun avantage économique ou commercial ». Pas de problème donc pour nous!

CPCrulez[Content Management System] v8.7-desktop/cache
Page créée en 083 millisecondes et consultée 1085 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.