ZXDB
Programming: General · ZX81 16K · 1 players
Bug-Byte Software Ltd · 1982 · Pound sterling 6.50
Discussion
Nobody has started a thread about this yet.
Remarks
Debugging utility
Releases
- Unknownpublisher not recorded
- 1982Bug-Byte Software LtdPound sterling 6.50
Play
- ZXDB.ZIPZX81 archive file 4 KB
Files and rights
No permission is on record either way. Screens and pictures are copied here on a take-down basis: if you hold the rights and want something removed, say so and it goes.
Credits
- Bug-Byte Software Ltdcredited
Sign in to credit somebody, or say what these people did.
In the magazines 7
Sinclair User #17Aug 1983 · p.48
John Gilbert
MAKING MACHINE CODE EASIER TO UNDERSTAND Following last month's review of assemblers John Gilbert turns his attention to their counterparts the disassemblers. The term disassembler has been used in many ways by professional producers of software to describe their products and some confusion has arisen as to what a disassembler should or should nor do. The strict definition of a disassembler calls for a program which will translate the numeric values of machine code into the mnemonics of assembly language. There are other packages which do all kinds of things with machine code but do not fulfil that definition. The correct term for those packages is toolkit. The mnemonics of assembly language look like shortened versions of Basic keywords. They are used to represent the machine code numbers which computers can understand but which human programmers still find difficult to cope with in great quantities. It is much easier to understand a mnemonic such as RET, which means Return to Basic, than its machine code counterpart, which in this case is 201. Most disassembler packages include a monitor program which allows the user to change machine code stored in RAM which has been disassembled. The disassembler makes the editing process easier, as mistakes can be spotted quickly if the programmer has a disassembly and not just a list of numbers which have to be sorted. When computers had just been invented there was little software and languages such as Basic and Pascal did nor exist. Programmers had to use programs which consisted of long has of numbers. You can imagine the trouble if those programs did not work. Every number in the program would have to be checked to see if it was correct. The invention of assemblers and disassemblers made things easier. You could enter code in mnemonic form using the assembler and check the code using the disassembler. When microcomputers were invented the disassemblers used on the large mainframe computers had to be altered to work on the smaller systems, as many of the instructions which were used on mainframes could not be used on micros. The first disassembler to appear commercially for the ZX-81 was ZXDB, from Bug-Byte. The company has built its reputation with that package along with its ZXAS assembler and the reason was because it was cheap and ran on an expensive computer. The Bug-Byte disassembler was fairly standard in its performance. It allowed you to specify the address, or position in memory, at which you wanted the disassembly to start. The program would disassemble one line at a time and you had to press NEWLINE for the next instruction in memory to be disassembled. The ZXDB for the ZX-81 used two fields, or areas, on the screen in which to display information. The first showed the address at which an instruction was located and the second showed the disassembly of the machine code instruction. Other disassemblers, such as the Crystal Computing Monitor and Disassembler for the Spectrum, use three fields. The extra area on the screen is used to display the numeric machine code on which the disassembler is working. It is a good idea as you can check the mnemonics and machine code against each other to see if the disassembler is working correctly. If a company produces both a disassembler and an assembler it usually makes both programs compatible. That means that both programs can be put into the computer to work together and dispenses with the need to load one program to enter code and then load the next to check that the code is correct. Having both programs in RAM at the same time will make programming in machine code quicker and easier but the amount of memory left for machine code programs will be reduced drastically. The advantages outweigh the disadvantages, though, so it is a good idea to buy a disassembler which can be used together with an assembler. Two problems occur when a disassembler starts to produce question marks because it has not been programmed to recognise a machine code instruction. One disassembler which does not follow the Z-80 instruction set is ZXDB from Bug-Byte. The program uses 8080 code instead of Z-80. Instructions which are common on the Z-80 are named differently on 8080. For instance, LD in Z-80 is called M in 8080 code. Those two names mean different things. The LD instruction means load a register with a value, whereas M means move. Trying to use a disassembler which does not understand the full Z-80 instruction set is like trying to use BBC Basic on 3 Spectrum or ZX-81. As BBC Basic is not the same as Sinclair Basic, the machine would not recognise the extra commands of the other language. As a result, when buying a disassembler, make sure that the program understands the complete Z-80 instruction set and not just a subset. Disassemblers can serve two purposes. They can be used to view code which you have stored in RAM or they could be used to look at the ROM of the machine With a good disassembler you could obtain a listing of the complete Sinclair ROM for either the ZX-81 or Spectrum. If you knew sufficient about machine code you might also be able to tell how the ROM works. To investigate the ROM, or go bug-hunting in it, you need the proper kind of disassembler. Picturesque produces a monitor and disassembler package which suits the purpose. The disassembler has to provide facilities for output to a printer, as the Basic interpreter and operating system within the ROM are very lengthy. A true analysis would have you jumping to different parts of the ROM when JP, or JumP, instructions are indicated. JumP is similar to the Basic GOTO instruction but there are many options available with that command and the disassembler will help you to spot them. Your disassembler should be capable of handling the RST instruction as it is used many times in the ROM. It means ReStarT and the instruction provides a quick entry point into the ROM for programmers using ROM routines in their machine code programs. The RST 10 instruction, for instance, would send the computer control to the part of the ROM which deals with the printing process. The routine sets up the machine to display one character on the screen. Most disassembler packages on the market for both Sinclair machines are being sold mainly as an afterthought to assembler packages. The disassembler has a very important role in computing and the second-class sticker with which it has been labelled is unfair. A disassembler should be a necessity when you are writing machine code programs. If you are to buy one, take as much time about choosing it as you would when buying an assembler. In many cases it will be the disassembler which will disappoint you with its performance and not the assembler. For instance, the Bug-Byte ZXDB was a breakthrough when it was launched but with hindsight it is somewhat mediocre. The standard of the documentation with ZXDB was far from satisfactory; as a result, the program was difficult to use. Disassemblers are becoming more complex all the time and there is not much which can be done to improve them. Many of the programs on the market, however, could be streamlined to fit into less RAM than is now the case. DK'tronics, [redacted]. Crystal Computing, [redacted]. Picturesque, [redacted].
'Many programs on the market could be streamlined.'
'The strict definition of a disassembler calls for a program which will translate the numeric values of machine code into the mnemonics of assembley language.'
Sinclair User #4Jul 1982 · p.41
Phil Garrett
AIDS FOR SPEED AND EFFICIENCY The popularity of writing in machine code is growing, Phil Garrett looks at the systems which can help. Judging by the popularity of Space Invader-type arcade games for the ZX-81, and of books such as Toni Baker's Mastering machine code on your ZX-81, it seems the ZX-81 owners want not only to run machine code programs but write them, too, That is scarcely surprising, considering the tremendous speed and efficiency of a machine code program compared to Basic, but there is a trade-off involved. I wrote a three-dimensional Noughts and Crosses program for my ZX-80 which played a good game but had a response time of 45 seconds, A year later I wrote the same program in machine code on my ZX-81 and it had a response time of less than half a second, Writing that program, however, had taken eight complete days of my summer holiday. Broadly speaking, there are three types of program available to aid the budding machine code adventurer, The most complex and probably most useful programs are the assemblers, which convert mnemonics into machine code; then there are disassemblers which do the reverse and, finally, monitor programs which allow close examination of a machine code program as it runs, plus other functions, When Zilog produced the Z-80 microprocessor, each of its hundreds of instructions was given a mnemonic so that users could remember what a particular instruction would do, For example, LD A, H means load the Accumulator with the contents of the H register and represents 124 in machine code, The mnemonic is entirely arbitrary and could just as well have been LOAD A FROM H. We could produce a machine code program by POKEing instructions byte by byte into RAM and plenty of machine code loader programs do just that, The method, though, is highly error-prone and time-consuming if the program is substantial, On the other hand, an assembler program converts the mnemonic form of instructions - which we can understand reasonably easily - into machine code which the microprocessor can understand and execute. In some ways the assembler program is similar to the Basic ROM in the ZX-81, The ROM scans the program for Basic keywords - LD, CALL - and then places the corresponding instruction in the RAM. The ability to use labels makes an assembler very powerful, as it allows the programmer to refer to instruction lines, subroutines, and even date by means of symbols, rather than having to determine the addresses each time. Sufficient of the theory; how are the ZX-81 assemblers used? BugBytes ZXAS assembler is in 5K of machine code, with a few lines of Basic to operate it, The program resets RAMTOP automatically and loads itself above it, so that assembler source programs can be loaded and saved separately, Lines of mnemonics are entered in REM statements, with multiple instructions allowed, provided they are separated by semi-colons, Up to 256 labels can be used in the form :L0 to :L255, and comments may be placed after a "*", Full-stops are used instead of commas - e.g, LD A, H - which makes typing instructions easier and numbers may be entered in decimal or hex, When the assembler is run, you are prompted for the starting address for the resulting machine code, Invariably I use a REM statement at the start of the program, and compile the machine code from 16514, The assembler code is then displayed on the screen in the format source line number: address (in hex): opcode and data (in hex); Z-8O mnemonic, If there is an error, the assembler stops with an error code, so it is not difficult to build a syntactically-correct source program. There is at least one bug in ZXAS: the SUB A,n instruction does not work but it can be replaced by AND A; SBC A,n which does the same, ZXAS is a remarkable program and is excellent value at £5. The only other ZX-81 assembler I have encountered is produced by ACS Software, It is similar to ZXAS in size and operation, with instructions entered in REM statements and labels available in the form Q.1: Q.255:. Data must be entered in decimal rather than hex - I prefer decimal - and there is a useful DFB function which allows you to specify the contents of a particular byte during assembly, so you can have messages embedded in your machine code. The assembled listing display is slightly different from ZXAS; you are given the decimal address, hex opcode and data, and then the mnemonic. The ACS assembler is also excellent value at £5.50 and the use of either this program or ZXAS is the single biggest step to proficiency in machine code programming. Neither program sets out to teach assembler, so a book will also be needed, I use the thorough but expensive Programming the Z-80 by Rodney Zaks but there are now several books available specifically for machine code programming on the ZX-81. Disassemblers convert machine code into mnemonics, making it easier to analyse and amend, The ACS disassembler can be used at the same time as its assembler and provides mnemonic listings in the same format, All addresses are shown in decimal and destination addresses are shown for relative jumps rather than the displacement, which is an excellent idea. All the other disassemblers have additional bells and whistles to assist with editing and debugging machine code, Campbell Systems 4K disassembler uses plenty of Basic and its machine code occupies my favourite 16514 onwards area of RAM, It has a handy facility to step backwards and displays contents in hex, with addresses and mnemonics in decimal, You cannot dump direct to the printer and you have to use the break key to return to Basic, Machine code can be entered, and individual bytes changed, using hex, This program, price £4, has been available since June, 1981 and has perhaps been superceded by some of the others on the market. The Aylesbury ZX Computer Club has decided courageously to enter the software fray with its disassembler, It is a very large program (14K) and runs a little slower than the others, The display, which can go to screen, printer, or both, is unusual; addresses, contents and mnemonic data are given in both hex and decimal and the display allows one line for each byte, There is also a facility to enter machine code from address 30000 in either hex or decimal and an Edit function to alter a byte or copy a block of bytes from one area of RAM to another, It is good value at £3.50 plus 50 pence for postage and packing. Bug-Bytes ZXDB disassembler can be used in conjunction with its ZXAS assembler and occupies 4K from address 16514, It works entirely in hex and does not dump to the printer, although you can circumvent that by disassembling 12 lines or so, then calling 0869H, which is the Sinclair ROM COPY subroutine. Another disadvantage is that some of the mnemonics belong to the 8080 rather than the Z-80, e.g., LD A, (HL) appears as LD A,M, It has a very large number of sophisticated monitor functions, so I have included it among the monitors as well, ZXDB costs £6.50. MicroGen Debug is also a disassembler with some monitor functions, works entirely in hex, and can be used with a printer, Care has to be taken when transferring from Basic to Debug and back, or the ZX-81 will crash, I found the monitor display impressive, although more detailed instructions would have been helpful, The program lives above RAMTOP, which it re-sets automatically, and costs £3.95. ACS-Debug can be used in conjunction with the ACS assembler and disassembler to provide a complete, if rather expensive, machine code writing package, It stores above RAMTOP, uses decimal numbers only, and does not dump to the printer, Once again, it costs £5.50. The Picturesque ZX-MC is another sophisticated monitor; it is rather like a separate operating system, You cannot use it with any existing machine code programs, as it uses low memory and has its own stack in high memory, It has its own loading and saving routines which operate at twice the speed of the ZX-81, The program is complete with a comprehensive manual for £7.50 but I believe its incompatibility with other programs is a serious disadvantage. The Taurus Machine Code Monitor is placed above RAMTOP and is available as a cassette and also in EPROM form as part of its 16K RAM pack system, With the letter you can switch from 14K RAM plus 2K monitor to the full 16K RAM, Apart from the usual functions, it has a helpful hex calculator and a facility to create REM statements of any length, It also has a comprehensive manual at £7.50 in cassette form, and the RAM-pack system costs £48. Bug-Byte, [redacted]. ACS, [redacted]. Campbell Systems, [redacted]. Aylesbury ZX Computer Club, [redacted]. MicroGen, [redacted]. Picturesque, [redacted]. Taurus, [redacted].
"In some ways the assembler is similar to the Basic ROM in the ZX-81."
"There is a trade-off between the speed of the final program and the time taken to write it."
Advert3
- Sinclair User #4Jul 1982 · p.2
- Sinclair User #2May 1982 · p.2
- Sinclair User #1Apr 1982 · p.2
Feature1
- Sinclair User #4Jul 1982 · p.42
Review1
- Sinclair User #1Apr 1982 · p.53
Related
- Same entry at
- Spectrum ComputingZXInfo
Reviews from people here
Sign in to write about this, or make an account. It takes a minute and lets you correct the catalogue too.
No language, tag recorded.
Sign in to correct or add to this.
Hold the rights to this and want it taken down?