HiSoft Software for the ZX Spectrum Devpac 4 Additional Notes to be used in conjunction with the Devpac 3 User Manual Thank you for buying HiSoft Devpac 4 for the ZX SPectrum, we hope that the product will suit your purposes and that you will find it enjoyable and easy to use. Devpac 4 is similar in use to the previous version for the Spectrum, Devpac 3, but has some additional features together with some changes in the existing commands. This document describes the changes and enhancements that make Devpac 4 one of the most powerful assembler/debugger packages available for the Spectrum computers, you should read it carefully in conjunction with the separate Devpac 3 manual. What's New in the Assembler/Editor? In General GENS4 runs with interrupts on and works on 48K and 128K Spectrums with cassette tape and ZX Microdrives. It is also fully compatible with the Disciple disc interface. A version is available that works with the Opus Discovery disc system which has all the features that are described here; simply replace the word microdrive with Opus disc when applicable. We shall now detail the additiona and differences as compared with the DevpacGENS 3 manual. Page 1 GENS4 is roughly 10K in length and is loaded, by default, at location 26000 although you may load it at any sensible address; it is usually convenient to load GENS into low memory. You enter GENS4 just like GENS3 by RANDOMIZE USR xxxxx [ENTER] where xxxxx is the address at which you loaded the assembler. If you re-enter GENS at xxxxx then you will get a warm start that preserves your text; there is no cold start into GENS4. There are two versions of GENS4 on your tape on side 1; the first version has 51 characters per line whilst the second is a regular 32 column version. Their names on the tape are GENS4-51 and GENS4 respectively; you should use whichever version suits you best, the 51-column version is some 400 bytes longer than the 32-column one. Once you have entered GENS4 you are presented with a help screen that displays the editor's commands in two columns with a capital letter indicating the command letter e.g. the command V displays the current Values of certain useful parameters. This help screen can be displayed again with the H command. Page 2 To make a back-up copy of GENS4 use SAVE "GENS4-51" CODE xxxxx,11392 [ENTER] or SAVE "GENS4" CODE xxxxx,10880 [ENTER] depending on which version you wish to back-up. You should do this back-up before entering GENS4 so as to preserve the relocation information. Page 3 The A command does not prompt you for the symbol table size or for any options. Instead the syntax of the A command has changed: An,m,s n gives the options required which are the same as described on page 3 except that Option 4 turns listing on not off. If n is not specified then all options are taken as being absent. m specifies the symbol table size in bytes as described on page 3, normally it will be sufficient to default this by not entering any number. s represents a powerful extra feature of GENS4. If s is present, it should be a valid microdrive filename; microdrive filenames start with d: where d is the drive number where the file is to be stored. The presence of a filename s causes the assembler to behave in a different way from normal; instead of simply assembling the object code to memory and telling you when the top of memory is reached the assembler will now assemble your code into memory until it reaches the top of memory (you can now specify this with the U command) and then it will save the object code assembled so far to microdrive under under your filename and put any subsequent object code generated into memory until top of memory is reached when it will save this to your file on the end of the file etc.; the assembly will continue like this until all of your program has been assembled and saved to microdrive. There is thus no limit (except the available space on your microdrive cartridge) to the size of the program you can assemble. There are some points to remeber when using this facility: 1. The ORG directive will cause object code to be place at the ORG address initially and after each time code has been saved to the object file unless option 16 is used to ensure that object code is placed directly after the symbol table. It will normally be sensible to use option 16 when assembling directly to microdrive since this gives the maximum size for your object code buffer, the execution addresses of your object code will not be affected. 2. You should avoid using more than one ORG in your program unless you pad out any intervaning memory with zeroes by using DEFS e.g. ORG 50000 ;some code RET ORG 60000 ;some more code will not be saved to microdrive correctly because the second ORG effectively redefines the start of the object code buffer. However: ORG 50000 ;some code RET ;pad out until 60000 DEFS 60000-$ ;some more code will be saved correctly since the DEFS 60000-$ generates sufficient zeroes to ensure that subsequent code starts at address 60000. This is obviously inefficient in terms of the amount of code stored on microdrive but its simplicity keeps the assembler small and fast. 3. If the filename you ask for already exists then you will be asked if you want to delete the existing file; if you answer N or n then the assembly will be aborted, otherwise the existing file will be deleted. An example of the use of the A command is: A20,,1:TEST [ENTER] assemble, with list on, putting the object code immediately after the symbol table, using a default symbol table size and saving the object code to microdrive 1 under filename TEST. Page 4, 5 In the 51-column version, the assembly listing is continuous, both to screen and printer, and does not split into two or more lines as described on page 4, the *C command works normally though. In the 32-column version, the same POKEs described on page 5 can be made to modify the listing format. Page 16 You cannot specify an include buffer size of 0, a buffer size of 1 is the minimum allowed. Page 27 The C command no longer performs a cold start, destroying your text; instead the text is moved up or down in memory as the buffers increase and decrease in size. There is no Q command in GENS4. The V command gives a display of useful information; the values of the default command parameters N1 and N2, the default command delimiter, the start and end of text (in decimal) and the value of the first command string, S1. Page 28 The X command now has the syntax Xn and gives a catalogue of microdrive number n. In 51-column mode the screen is cleared first. The catalogue is always displayed in 32 columns. The previous function of command X, to show the start and end of text, is noe performed by the V command. The Z command. This effectively deletes all your text and therefore asks you whether you are sure that you wnat to proceed, answer Y or y to delete the text. Apart from being a quick shortcut for D1,32767 the Zap command allows to clean up your textfile if it has somehow become corrupted, for example you might have loaded a code file in error. The Z command obviates the need for a cold start entry point into GENS4. Pages 33-37 The example remains mostly unchanged except that you are no longer asked to specify the Table Size and Options; these should be entered on the command line as described above. What's New in the Debugger? In General MONS4 runs with interrupts on and works on 48K and 128K Spectrums with cassette tape and ZX Microdrives. It is also fully compatible with the Disciple disc interface. A version is available that works with the Opus Discovery disc system which has the features that are described here; simply replace the word microdrive with Opus disc when applicable. The debugger now detects the interrupt state whenever it is entered, be it after a breakpoint, from BASIC or when single-stepping and displays this state as either ON or OFF after the flags display on the Front Panel. Thus you can now single-step the instructions EI and DI without problems. Otherwise, the Front Panel display remains as described in the Devpac 3 manual. There is one extra feature which allows you to disassemble to microdrive and this is described below together with details of some other small changes. Page 45 MONS4 is roughly 6K in length and is loaded, by default, at location 55000 although you may load it at any sensible address; it is usually convenient to load MONS into high memory. To make a back-up copy use: SAVE "MONS4" CODE xxxxx,6656 where xxxxx is the address at which the package was loaded. Make a back-up before executing MONS4. Page 46 To get back to BASIC you should press STOP i.e. [SYMBOL SHIFT]-S; this returns neatly to either 48K or 128K BASIC. [CAPS SHIFT]-1 or [EDIT] does not get you back to BASIC, instead [EDIT] normally returns you to the Front Panel from whatever sub-task you may have been doing with the debugger. MONS4 does not disable interrupts whilst running and you are free to single-step EI and DI instructions. Page 53 When using the disassembly command T you can now disassemble to microdrive. You do this by entering a microdrive filename in answer to the prompt Text: instead of an address. A microdrive filename is a name preceded by d: where d is a drive number 1-8 e.g. 2:TEST specified the file TEST on microdrive number 2. So, when prompted Text:, simply enter a name of the form d:name, specify an area for the Workspace: and disassembly will go to microdrive in a from that can be loaded by the assembler's G command. The only limits to the size of the disassembly are the available space on your microdrive and the workspace size. Note that the byte after RST 8 instructions will be disassembled as DEFB n since the byte is picked up by the Spectrum ROM and is never executable code on the ZX Spectrum. We hope you enjoy using Devpac 4; should you experience any problems in the use of either package please feel free to write to us, clearly explaining the nature of the problem and when it occurs (listings are often useful). You can also phone for technical support between 4p.m. and 5p.m. every weekday. HiSoft The Old School, Greenfield, Bedford MK45 5DE Tel: (0525) 718181