APPLICATIONSDIVERS ★ Page Utility ★

RSX Page Utility (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 ★ 

IF you flick through the pages of Computing with the Amstrad you'll see that most of the program listings are quite short. With around 40k of RAM free it means that very little of your Amstrad's memory is being used at any one time.

Wouldn't it be useful if we could store several Basic programs in the memory at once, and be able to switch between them and run any one?

You could then have all Pete Bibby's example programs from this month's beginners article in memory at the same time, for instance. You would be able to select one, run it, select another, run that, then compare the results. It would save a lot of typing or accessing the disc or tape.

That's just one of many uses once you have this ability. It opens up a whole new range of possibilities.

For instance one program could be used to modify another. It wouldn't be difficult to write a utility to compact a program, taking out the REMs. You could also have a search and replace utility so that you could change variable names, and so on.

These are just a few ideas. I'm sure you can think of many more.

The program accompanying this article will enable you to store and run Basic programs at any address in the memory. This means that you coutd load one program at &1000 say, then another at &2000 and a third at &3000. Any of the programs can be selected and run.

You don't have to use nice round figures like & 1000, though it's easier to keep track of where you've put all your programs if you do. It's quite easy to lose track of where your programs are! Also it's up to you to make sure that the program you put at one address doesn't overwrite the program at another. However with so much RAM free it's not difficult to find a bit of space.

Program I is a Basic listing of the utility and Program II is an assembly listing. When it is run several new commands are added to Basic. They are listed in Table I.

The first |PRINT.PAGE, prints the value of a system variable I've called PAGE. This is at &AE64 if you have Basic 1.1 or &AE81 if you have Basic 1.0. The second command, |SET.PAGE, as you've probably already guessed, sets the value of PAGE.

When you type a program in or load it from tape or disc Basic stores it at PAGE. Then when you type SAVE Basic saves the program stored at PAGE and when RUN is entered the program at PAGE is run.

If we alter the value of PAGE we can enter or load another program without affecting the first, providing, of course, that we don't overwrite it.

  • |PRINT-PAGE
  • |SET.PAGE,integer
  • |GET.PAGE ,@variable%
  • |GET.TOP,@variable%
  • |GET. LOMEM, @variable%
  • |NEW.PROGRAM

Table I: New commands

It's not just a matter of altering one system variable though. If we want to go back to our original program and we alter PAGE to its previous value, the program won't be magically restored. We have to do that ourselves.

As well as keeping track of where a program starts, Basic also needs to know where it ends. This address is stored in another system variable which I'll call TOP.

The end of a Basic program is marked by a couple of zero bytes. So to find TOP we search through the program line by line until we come to them. The address is then stored in TOP.

Basic needs to know TOP since this is where the Basic variables are stored when the program is run.

Several other pointers need to be set to the same value, the ones that tell Basic where the variables end. The variables are placed at the end of the program starting at TOP.

By restoring all these pointers we restore the original program, which can be run again. The variables will be lost though, and it's always best to enter CLEAR when changing PAGE.

All this is carried out automatically by the utility. So if PAGE is changed the routine looks to see if a program is stored at the new address. If there's nothing there, or if it can't follow the program because it's been corrupted, |NEW.PROGRAM is executed.

This command will delete the program at PAGE without destroying any other programs in the memory. The normal Basic command NEW destroys everything in the memory, so use it with caution.

A program may need to know what PAGE, TOP and LOMEM are -LOMEM is the lowest point in the memory which is free. The commands |GET.PAGE, |GET.TOP and |GET.LOMEM look up the relevant system variable and place its value in one of Basic's integer variables.

a%=0
|GET.PAGE,@a%

will set a% to the current value of PAGE.

Page is an extremely useful utility and a great help when programming. It enables you to take full advantage of the generous amount of RAM in your Amstrad.

CWTA

★ PUBLISHER: COMPUTING WITH THE AMSTRAD
★ YEAR: 1986
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1986
★ AUTHOR: Roland Waddilove
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» RSX-Page  Utility    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-23
DL: 185
TYPE: ZIP
SiZE: 5Ko
NOTE: 40 Cyls
.HFE: Χ

» RSX-Page  Utility    (Computing  with  the  Amstrad)    LISTINGDATE: 2013-05-05
DL: 288
TYPE: text
SiZE: 3Ko
NOTE:

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

Lien(s):
» Applications » RSX Tortuga (Amstrad Personal)
» Applications » RSX (Computing with the Amstrad)
» Applications » Format (Compute Mit)
» Applications » RSX Fast Format (Damijan & Ivo)
» Applications » RSX Mirror (CPC Magazin)
» Applications » RSX Fade Mix (Popular Computing Weekly)
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 310 millisecondes et consultée 1607 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.