APPLICATIONSUTILITAIRES RSX/LIGNE DE COMMANDE ★ MEMDUMP|COMPUTING WITH THE AMSTRAD) ★

Memdump|Computing with the Amstrad)Applications Utilitaires Rsx/ligne De Commande
 ★ 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 ★ 

ROLAND WADDILOVE offers an interrupt-driven machine code routine to persuade your Amstrad to give up its secrets

A MEMORY dump is a very useful tool for examining each byte of a micro's memory, allowing you to check the state of the variables, check that your machine code routines are working properly and so on.

The disassembler in the November issue of Computing with the Amstrad featured such a dump, enabling you to list any part of the Amstrad's memory map in hexadecimal and Ascii.

It produces a sort of snapshot of the memory. The contents displayed are what was there when the program was run.

If any of the memory locations have since changed it will not show up unless the memory is dumped again and two compared. And it might even happen that the locations you're interested in are themselves altered by the dump program.

Under most circumstances this is perfectly acceptable. However sometimes we need to be able to monitor locations to see how they change and what values they range over.

Some locations for instance, change quite rapidly, particularly those used by firmware for variable storage. In these cases what is needed is a dump utility which is fast and which corrupts the memory as little as possible. This is the purpose of MemDump - an interrupt-driven machine code routine which sits at &A000 in the memory.

Called 10 times per second, it prints the contents of 32 memory locations on the screen.

Since it is interrupt-driven it is possible to run another program at the same time, allowing you to monitor how the second program uses memory or the effect it has on the firmware variables.

The rate at which MemDump scans memory can be altered easily from as fast as 50 times a second to as slow as several seconds. This should be sufficient for most purposes.

To change the rate, alter the value loaded into the DE registers at & A08C to the number of fiftieths of a second required. At present this is set at 5/50ths of a second.

The routine adds three new commands using RSXs. The first, iENABLE, changes to Mode 2, sets up a text window and enables the interrupt routine.

The second command iDISABLE, disables the routine and the third, IMONITOR, (numeric expression) sets the start address of the dump.

The window provides a neater display, the top two lines being used for the dump and the rest of the screen free. Using them will not do any harm though, it just produces a messy display.

Changing mode will make the display unreadable, as MemDump uses its own print routine designed specifically to print in Mode 2. The character definitions are grabbed straight out of the lower ROM and poked directly into the screen memory, without using the firmware at all.

Why? Well, it would be impossible to print 32 memory locations 50 times a second using the firmware calls, they're just too slow.

Program 1 is an assembly listing of MemDump. If you haven't an assembler (shame on you - there was one in our July issue) use Program 2 to enter the hex codes. You don't need to enter the first number, this is the address.

The machine code can be saved with:

SAVE"MENDUMP",B,&A00,&170

Once you've got MemDump you'll want to use it. One of the most interesting areas of memory to examine is from &AC00 to &B900, which is used by the firmware.

The keyboard input buffer is around &ACA0. It may change on the different Amstrad models so you'll need to hunt around a bit. Use |MONITOR to scan through addresses close to &ACA0, pressing keys at random on the keyboard and looking for altered bytes - you'll soon spot the buffer.

Basic's variables are stored around &AE00. Here you'll find the start address of the Basic program in memory, if any, its end address, where the variables start and end, HIMEM and so on. If you monitor this area while a program is running you'll find two two-byte locations which contain the address of the line Basic is executing and the address of the statement it's currently executing.

This raises many possibilities for future experiments, such as interrupting Basic and changing the pointers so that it carries on executing somewhere else.

The Amstrad's memory is largely unexplored, particularly the newer models so you're on your own. Happy hunting!

CWTA

★ PUBLISHER: Computing with the Amstrad
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LICENCE: LISTING
★ AUTHOR: ROLAND WADDILOVE

★ AMSTRAD CPC ★ DOWNLOAD ★

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):
» Applications » Variable Dump (Computing With the Amstrad)
» Applications » Inversion d'Ecran
» Applications » Rsx - Input (CPC Amstrad International)
» Applications » Déverouillons les RSX (CPC Revue)
» Applications » Kitutil (CPC Infos)
» Applications » Rsx - Resident System Extensions (CPC Amstrad International)

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.75-desktop/cache
Page créée en 142 millisecondes et consultée 624 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.