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, in 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: 277
TYPE: PDF
SiZE: 352Ko
NOTE: Uploaded by CPCLOV ; 4 pages/PDFlib v1.6

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

Lien(s):
» Coding Src's » Muzyka Robota (Bajtek)
» Coding Src's » Tunnel
» Coding Src's » Sound Programming (Computing with the Amstrad)
» Coding Src's » Roll-It
» Coding Src's » A Very Moving Experience (Sean McManus and Amstrad Computer User)
» Coding Src's » Abrollen
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.7-desktop
Page créée en 244 millisecondes et consultée 2984 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.