CWTA Issue 46 - October 1988 - Type-Ins
The following listings were published in the October 1988 issue of Computing_with_the_Amstrad:
- Maxam Utilities (David Instone-Brewer)
- Directory Checker (Ronnie Heywood)
- Screen Mode Converter (Jeremy Dutton) NB error in original listing corrected here
- 3D Donut (Ian Breeze)
- Cubots (Paul Robson)
- All files here originally created by Nich Campbell.
- The second part of the Programming Clinic article to create a club database by Ian Sharpe was published with the listing NB not included on the dsk.
- The first part of a series called Bring Those Sprite To Life by Ian Sharpe was published with machine code.
- A listing for Non-repeating Random Numbers by Arthur Pounsett was published in the Postbag section (included on dsk image).
- Two RSXs to add extra functionality to the Maxam assembler and Protext.
The program saves a file to the disc called ASM+STEP.&9E. The &9E extension means that the file must be loaded to &9E00, so the extension (and therefore the address which the program is loaded to) depends on the value of HIMEM when you run the program. To load and initialise the RSXs again, type: MEMORY &9DFF:LOAD"ASM+STEP.&9E",&9E00:CALL &9E00 or the equivalent, depending on the file extension.
The first RSX is |ASM. Maxam 1.5 users already have this command, which allows you to assemble a Maxam file from Protext. However, users with earlier versions of Maxam have to load their files into Maxam's editor and then assemble it. Thanks to the addition of the |ASM command, you can now assemble your files from Protext, which has a better editor than Maxam.
The second RSX is |STEP. It allows you to step through a machine code program one instruction at a time. To use it, type |STEP,address, where address is the start address of the code that you wish to monitor. Each instruction is displayed on the screen, along with the values of all the registers. To execute the instruction, press any key other than ESC, RETURN, DEL and TAB (these keys have special functions). If you encounter a CALL instruction and want to execute this subroutine without stepping through it one instruction at a time, press RETURN; note that if a firmware CALL is encountered, it will automatically execute it without stepping through it. To prevent the current instruction from being executed, press DEL.
You can also change the values of the registers at any time by pressing TAB. You can then enter new values, or leave them unchanged by pressing RETURN at the appropriate moment. You can even change the current instruction and the status of the flags, although be careful not to enter an instruction that is longer than the current one (e.g. entering JP &8000 (three bytes) in place of LD A,1 (two bytes) will cause problems).
You can stop at any time by pressing ESC, and entering |STEP again, without any parameters, will restart the stepping process where you left off. There are a few restrictions on the use of the |STEP RSX; you must have interrupts enabled, and you cannot step through some of the RST instructions, but these rarely occur so it's not a big problem. In fact, the RSX works by intercepting the RST 6 function which is used by Maxam to enable breakpoints. The program is designed for early versions of Maxam, and using |STEP with Maxam 1.5 is much more awkward.