★ APPLICATIONS ★ DIVERS ★ Program Status ★ |
Program Status (Computing With the Amstrad) | Applications Divers |
WHEN developing software it's often necessary to know exactly how long your program is, where it is stored, how much memory is left and so on. This sort of information isn't readily available on the Amstrad and at times it can be a nuisance having to perform lots of calculations to find out something as basic as how big your program is. Status is designed to make life as easy as possible by providing you with all the information you require. Run the program and a short routine will be stored above HIMEM. To use it just CALL &A000 and you'll to told the value of HIMEM. LOMEM. PAGE and TOP. The length of any program currently in memory is printed along with the space taken up by any variables and strings and the amount of free memory left. LOMEM, PAGE and TOP aren't recognised by Locomotive Basic -they are names I've borrowed from BBC Basic. LOMEM is the lowest point in the memory that is free. PAGE is where the Basic program is stored - it's always exactly at the start of a page of memory on the BBC Micro or Electron, but needn't be on the Amstrad. TOP is the top of the program - that is, the address at which it ends. The routine works by peeking Basic's variables starting at &AE00. PAGE is stored at &AE81/64 - Basic 1.0/Basic 1.1, HIMEM at &AE7B/5E, TOP at &AE85/68 and LOMEM at &AE89/6C. The rest of the information is calculated from these values. For instance the length of a program is PAGE - TOP. Armed with these facts you should now be able to make more efficient use of your Amstrad's memory.
|