Disc - Header Reader (Your Computer)Coding Listings
★ 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 ★ 

I HAVE WRITTEN' a program similar to ones published previously for other computers e.g. the ZX Spectrum or the Amstrad CPC-464. It is a program written in Basic with a short accompanying Z-80 machine-code routine which reads the header at the beginning of a file on tape and interprets this to give the user the information recorded there, which is normally inaccessible to the user.

On running, the program first returns the screen display to its default conditions as at startup when switching on. This is achieved by the two calls to the firmware jumpblock: Call &BBFF and Call &BB4E. Using these two simple calls avoids having to reset all the seperate aspects of the screen display i.e. the Mode, Pen, Paper, Ink settings etc. These two calls are in fact quite useful in any program at the beginning to make sure that the effect of printing on the screen can be entirely predictable.

It then calls the subroutine at line 230 and onwards which simply pokes in the short machine code routine at 41000 onwards. It also lowers Himem to 39999 to give space for the routine and for the storage of the data obtained from the header, the amount of space allocated being in fact more than adequate, though this fact is unlikely to mean that there is unsufficient memory left for use by any program residing in memory, mainly because it is unlikely that any program other than the header reader would be in the memory.

The program then calls the machine code routine which starts the tape and searches for the header at the beginning of a file. Since the routine uses quite a low level ROM routine which does not give the user a prompt to press Play on the tape recorder, it is a good idea to the cassette installed in the datacorder and to have Play depressed before running the program though this is not essential. The actual machine code routine is as follows:

3E 2C
21 40 9C
11 40 00
32 5E 9C
LD A, &2C
LD HL,&9C40
LD DE,&0040
LD (&9C5E),A
; loads the parameters
; for the routine into
; A. HL, and DE.
; calls the ROM routine
; returns to Basic if OK
; generates an error byte
; which is placed in &9c5e
; returns to Basic

The Basic program then checks by Peeking location 40030 whether the routine called has been successful or whether an error has occurred. It also checks whether the user hit the Escape key during the ROM routine which halts its action, and acts accordingly. If the routine has run correctly then the program interprets the data stored at locations 40000 to 40063. In fact only the locations from 40000 to 40027 contain useful information, although the bytes in the header stored from 4028 to 40063 can contain useful information when the file is not created by Basic tape commands. In any case, whatever information this may be, it cannot be interpreted in terms such as block number or similar in the same way as the other bytes. Indeed, the information stored here is likely to have a unique purpose for every program in which they are used at all. The program displays the information under the headings Filename, Block Number, File type, Length of Data in Block, Address from which the file was written, Total length of file, the Entry Address in the case of machine code programs, and also says whether the block being read is the first or the last block or not and whether or not the program is protected.

Once the information has been displayed, the program pauses and asks whether the user wishes to continue to read another header. Any key other than n is taken to mean yes, while if n is pressed, the program ends. Otherwise, the program repeats the process, searching for another header. The time between when the Continue . . . ? message is displayed and when a key is pressed is a good time to change tapes, fast forward etc.

It would also probably be convenient, if the user owns a printer to change the appropriate Print statements to Print 8 statements to obtain a hard copy of the header information for later use.

I should be most happy to answer reader's inquiries about the program should any arise providing that the inquirer encloses an sae with any questions sent to me. I also am willing to provide a tape copy of this program to any reader if they send a blank tape and a cheque/PO for £1.00 inclusive of p&p to H.V. Smith.


★ YEAR: 1986
★ AUTHOR: Howard V. Smith


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...

» Coding Src's » Graphic - Planets (Your Computer)
» Coding Src's » 3D Cube
» Coding Src's » Sound - Musicfx (Amstrad Action)
» Coding Src's » Graphic - Random Symmetrical Pattern Generators
» Coding Src's » Stone's Rag
» Coding Src's » Graphic - Advanced Art Studio screen loader (Attack)

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