★ APPLICATIONS ★ PROGRAMMATION ★ Inside Arnold ★ |
HiRomLoRomRam (Popular Computing Weekly) | Applications Programmation |
Take a peek inside the depths of the Amstrad ROM with Colin Harris from Nemesis Software. It is interesting to note that although the CPC 464 has been readily available since July, the reports of 'bugs'have been very few. Indeed the only mention I recall is the absence of an explanation of the operator 'Mod'in the Handbook, but that doesn't really count. The traditional welcome to a new computer is the 'bug' report. Is the absence of these some kind of dubious acolade for the Amstrad? Notably, however, there has been more than one complaint that owners are unable to nose through the Operating System, more simply the ROM. The ROM in the CPC464 is split into two sections. One section of 16K occupies addresses 0-3FFF(HEX) almost, anyway. The upper ROM occupies C000-FFFF(HEX). and in doing so overlays the screen RAM. The lower ROM overlays part of the user RAM. This arrangement with clever switching releases the maximum possible area to user Ram during Basic operations. It is because of this that the ROM seems to be inaccessible to the Basic user. There is a one line program for the Dragon to produce a Hex or Character Dump of the ROM No such simple method will work with the Amstrad. In complete contrast to other computer manufacturers, Amstrad have made a wealth of information available to the user. The Complete ROM Disassembly of Micro X is often the eagerly awaited independent publication appearing long after the introduction of the computer. Amstrad's The Complete Firmware Specification (Ref. Soft 158), was available, in theory at least, from day one. This publication fully explains all the routines in the ROM that one could possibly want to use, and more! In here are the routines that will enable the Assembler Programmer to solve the problem. Obtusely enough, if you have a halfway decent Assembler package, you will not need a program to produce a Hex or Character dump; the Assembler/Disassembler probably has it built-in. In any case a Disassembly of the ROM is of much greater value. Nevertheless, to assemble this program gives one useful experience of the Amstrad's ROM routines and this of course leads to a Basic program to enter the code. Listing B is the assembly list. Listing A is the program for those without an assembler. Listing A — The Basic Program Type in the Basic program exactly as listed, paying special attention to the Hex numbers. The letters 'a to f which are used in the hex system are shown in lower case, as this way one is less likely to confuse B with 8. etc. Having entered it make a copy on tape before running it. If all is well the program will Poke the code into reserved Ram, and the screen will invite you to Call the program. If you have made an error in entering the data, you will have to check it and rectify the error. Check first that each data statement (the last has 11 only) contains 32 sets of hex numbers. When you have located your error(s!) re-save the program and try again. Now see the notes on using the program. The machine code program can now be saved to tape by: Save "HILOROM", B, 41656, 971, 42001. Call 42001 executes the program. Define a key to do this as in Line 30 of the Basic program. Program Notes
Listing B — the Assembler Listing The assembly listing was not written to be a model of assembly programming, nor to be the most efficient method or even a structured method. It was written to investigate the use of ROM routines and as such it is worth examination. It undoubtedly will extend to a full blown monitor. If you attempt this you will discover that the Concise Firmware Specification has everything you need Program Notes
When initiated the program offers a Menu. First press Caps Lock and then press the letter corresponding to the memory you wish to examine. Enter will stop the display to allow closer inspection. Also whilst 'stopped'you have the option to rapidly advance the memory display in increments of 256-bytes by pressing I When the indicator reaches the desired address press C to continue. Alternately E will return to Basic or 0 will return Screen Display From left to right the screen display consists of: Hex Address; eight hex values (the first corresponds to the Hex Addr. The remainder correspond to the previous address plus 1). Within the bounds of a small article and one simple program, many points will go unmentioned — much will be oversimplified.
|