Rampak|The Amstrad User)Applications Programmation
★ 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 ★ 

A machine code sub-routine package for the Amstrad CPC range.

No matter what the initial reason for buying your CPC, sooner or later you'll probably attempt writing your own programs. Most of us start with simple Basic programs. These are sufficient for a while until one day you ask yourself "Why can't I write programs that use all the snazzy effects achieved by most of the commercially written software?"

Well, the answer is... you can! The newly released machine code subroutine package, RAMPAK, will enable beginner CPC programmers to create fast, compact and more impressive programs. In fact, many experienced programmers may find some of the routines in RAMPAK very useful too.

"Just another collection of RSX commands loosely tied together with a few menus.. " I hear you say. On the contrary, RAMPAK is definitely not another RSX package - it's an integrated collection of very useful machine language sub-routines which may be easily incorporated into your own programs, either individually or as a whole unit.


The routines are loaded into memory as binary files and activated by using Basic's CALL statement. There are two advantages of this method over RSX (Bar commands). The first is that the overall package is shorter since extra memory is required for the RSX name and jump address tables as well as that used up by the actual routines themselves. This leaves more room for your programs. The second and probably the most important advantage is that if you only want to use a few of the routines in RAMPAK, any number can be individually saved and added to your own programs.

The package consists of nearly 50 subroutines which perform tasks that most Basic programmers would not have thought possible. For ease of explanation, I have broken the routines up into groups based on their area of influence.


The screen section is by far the largest and contains routines which allow you to:

  • generate different sized texts; draw boxes and triangles of any size; scroll either the whole screen or any predefined window in any direction; scrolled text may also be made to 'wrap around7, ie. re-appear on the other side of the window; write sideways up or down the screen;
  • display either a vertical or horizontal mirror image of any character;
  • cause the screen contents to fade out gradually (very impressive);
  • store the current screen contents in another memory location;
  • swap the stored screen with the active screen and vice-versa;
  • change the screen base address so that screens appear instantaneously.
For 464 owners there are also two routines available only on the later models. One allows for writing text at the graphics cursor and the other reads characters at predefined screen locations and stores the resulting ASCII code in a program variable.


There are two printer routines, the first generates a text screen dump in any mode and the second allows text printed on the screen to be echoed to the printer.


In the keyboard section there are routines that:

  • disable the ESC and CTRL-SHIFT-ESC keys so that a program may not be interrupted (or the computer rest) while running;
  • input a preset number of characters from the keyboard and store the resulting string in a program variable;
  • report on the status of the SHIFT CTRL, SHIFT LOCK and CAPS LOCK keys;
  • force all characters to upper case irrespective of the status of CAPS LOCK;
  • wait for a key press and if that character is part of a predefined string then its position in the string is passed to a program integer variable clear the keyboard buffer so that so that unwanted key presses are removed in a running program; wait for a key press and store the ASCII code of the character whose key was pressed in a program variable;
  • pause a program for a preset length of time or until a key is pressed.

Disc Drive

There is only one routine which apples to disc operation. This allows any disc sector to be read from disc or any 512 byte block of memory to be written onto any disc sector. This type of routine is used extensively by all the commercial copying and formatting packages. An interesting tip for the more experienced programmers is that this routine can be used to format a specified track (write your own disc copy program perhaps? However, you need to be familiar with the AMSDOS BIOS commands as outlined in the CPC Firmware Guide (Soft 968).


The cassette routines are somewhat more plentiful and include the following:

  • a routine to select six different cassette speeds;
  • two routines which save ar.d load headerless files;
  • another two routines which saw and load binary files in a unique fashion so that they may be catalogued by the CAT command but not loaded using the LOAD command. (Files saved in this way also load much faster than normal "blocked'files).

The final group of routines apply to the computer memory and consist of:

  • a routine which moves a block of memory from one address to another;
  • a routine which prints the length of any Basic program currently in memory;
  • another routine that protects Basic files from being listed. The protection can be switched on or off, even from within a running program; a routine which resets the Basic system variable TIME; two routines which peek and poke at consecutive memory pairs.

When the program is first loaded and run, a quick demonstration of some of the capabilities of RAMPAK are shown, after which the message "Rampak installed at address 39112" is displayed.

At this point the Basic part of the program has erased itself from memory and the sub-routines are installed starting at memory address 39112 (&98C8). You can now select which routines you wish to use and either try them directly from the keyboard or save them to disc or tape for later use in your own programs.

To save a sub-routine, use the information given on the last page of the manual. This is an alphabetical listing of all the routines available. Use this list to determine the starting address and length of the routine you wish to save. Once you have these, it's a simple matter to save the routine of your choice. Here is an example:

SAVE "IMAGEV",B,39264, 50

It is important to note here that nearly half of the routines in RAMPAK are * relocatable and may be reloaded at any convenient location in the memory pool.

To use the file saved above in your own program, simply include the following lines at the start (without the REMs):

5 MEMORY 39263 : REM One loss than the loading address
10 LOAD "IMAGZV",39264 : REM Or load at any convenient address if relocatable

15 REM The rest of your program goes hare

Now you can call the IMAGEV routine at any time from your own program using the command

CALL 39264,A

where A, in this example, is a variable which contains the ASCII code of the character you wish to print as a vertical mirror image.

Australian Made

Apart from the fact that RAMPAK is an excellent Australian product, its other main feature is that it Pills the gap for Basic programmers. Its unique approach will allow many to get the most out of their computers without getting too deeply into machine code.

RAMPAK is available post free through The Amstrad User at a cost of $44.95 for the disc version or $37.95 for the tape. Enquiries from dealers are welcome.


★ PUBLISHER: The Amstrad User (Australia)
★ YEAR: 1987
★ AUTHOR(S): ???
★ PRICE: $44.95 for the disc version or $37.95 for the tape


» RAMPAKDATE: 2015-01-08
DL: 78 fois
TYPE: image
SIZE: 125Ko

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

» Applications » Zen
» Applications » Step Inside
» Applications » Ams-Forth/Amsforth
» Applications » Comal-80/z80 rev. Amstrad
» Applications » Systeme Expert
» Applications » Microsoft Basic - 80

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